Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build/deps/webkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* for local mode. Override via `--webkit-version=<hash>` to test a branch.
* From https://github.com/oven-sh/WebKit releases.
*/
export const WEBKIT_VERSION = "c28156899e5f90ce22e2b5d780e117c6268edfc4";
export const WEBKIT_VERSION = "autobuild-preview-pr-674-6bf5befa";
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment thread
robobun marked this conversation as resolved.
Resolved

/**
* WebKit (JavaScriptCore) — the JS engine.
Expand Down
35 changes: 35 additions & 0 deletions test/js/web/timers/microtask.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { expect, it } from "bun:test";
import { bunEnv, bunExe, isDebug } from "harness";
import { totalmem } from "node:os";

// https://github.com/oven-sh/bun/issues/9249
it("queueMicrotask.length is 1", () => {
Expand Down Expand Up @@ -77,3 +79,36 @@ it("queueMicrotask", async () => {
if (!passed) throw new Error("queueMicrotask should throw a TypeError if the argument is empty");
}
});

// The microtask queue is one buffer that doubles, and a buffer of 2^26 tasks is past the 2 GB limit of a
// WTF::Vector, so the 2^25th pending task aborted the process. The child needs about 3 GB. It takes a few
// seconds in a release build and more than 3 minutes in a debug build.
it.skipIf(totalmem() < 8 * 1024 ** 3)(
Comment thread
robobun marked this conversation as resolved.
Resolved
"queueMicrotask accepts more than 2^25 pending callbacks",
async () => {
await using proc = Bun.spawn({
cmd: [
bunExe(),
"-e",
`
const count = 2 ** 25 + 1;
let ran = 0;
const callback = () => { ran++; };
for (let i = 0; i < count; i++) queueMicrotask(callback);
console.log("queued", count);
queueMicrotask(() => console.log("ran", ran));
`,
],
env: bunEnv,
stdout: "pipe",
stderr: "pipe",
});
const [stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]);
expect({ stdout, stderr, exitCode }).toEqual({
stdout: "queued 33554433\nran 33554433\n",
stderr: "",
exitCode: 0,
});
},
isDebug ? 600_000 : 60_000,
Comment thread
robobun marked this conversation as resolved.
Resolved
);
Loading