Repository navigation
Conversation
|
Updated 3:50 PM PT - Jun 16th, 2026
❌ @alii, your commit 8ef2b1f has 1 failures in
🧪 To try this PR locally: bunx bun-pr 29564That installs a local version of the PR into your bun-29564 --bun |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a new regression test file with four async tests verifying AsyncDisposableStack.disposeAsync() sequencing: LIFO disposal, awaiting Symbol.asyncDispose promises, adopt() and defer() callback ordering, and fallback to Symbol.dispose. Changes
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
Found 1 issue this PR may fix:
🤖 Generated with Claude Code |
There was a problem hiding this comment.
LGTM — test-only regression coverage for an already-fixed JSC bug.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, with three test cases covering AsyncDisposableStack.prototype.disposeAsync() behavior for use(), adopt(), and defer(). No production/source code is touched — the underlying bug was already fixed by a prior JavaScriptCore upgrade (#28371), and this just adds regression coverage.
Security risks
None. This is a pure test addition with no runtime, build, or dependency changes.
Level of scrutiny
Low. Test-only changes in test/regression/issue/ follow an established repo convention. The tests are deterministic (driven by Promise.withResolvers() rather than wall-clock timing), assert correct LIFO sequential disposal per the TC39 spec, and the PR description confirms they fail on 1.3.11 and pass on 1.3.12+/HEAD.
Other factors
No bugs were flagged by the bug-hunting system, no CODEOWNERS apply to this path, and there are no outstanding reviewer comments. The change is small, self-contained, and clearly intentioned.
There was a problem hiding this comment.
LGTM — test-only regression coverage for AsyncDisposableStack disposal awaiting.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, with four regression tests covering AsyncDisposableStack.prototype.disposeAsync(): sequential LIFO awaiting via use(), adopt(), and defer(), plus the Symbol.dispose fallback (issue #24277). No production/runtime code is touched — the underlying fix already landed via a JavaScriptCore upgrade in #28371.
Security risks
None. This is a pure test addition with no I/O, no network, no filesystem access, and no changes to runtime behavior.
Level of scrutiny
Low. Test-only changes in test/regression/issue/ follow the established pattern for issue regression coverage. The tests use Promise.withResolvers() for deterministic resolution control and await Bun.sleep(0) to flush microtasks between assertions, avoiding timing-based flakiness. The PR description confirms the tests fail on 1.3.11 (reproducing the bug) and pass on 1.3.12+ and HEAD.
Other factors
No bugs were flagged by the bug-hunting system, CodeRabbit had no actionable comments, and there are no outstanding reviewer requests. The test logic is straightforward and the assertions correctly encode the spec-required sequential LIFO disposal semantics.
|
@robobun resume |
|
✅ Ready to merge. Test-only PR: adds CI is red on unrelated infrastructure, not this diff:
|
ea9fa57 to
c6a9ad2
Compare
There was a problem hiding this comment.
LGTM — test-only regression coverage for already-fixed JSC bugs.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, containing four regression tests for AsyncDisposableStack behavior (sequential awaiting of use/adopt/defer disposers, and Symbol.dispose fallback). No production code is touched — the underlying bugs were already fixed by a prior JavaScriptCore upgrade (#28371), and this PR just locks in coverage so a future WebKit bump can't silently regress them.
Security risks
None. This is a pure test addition with no runtime, build, or dependency changes.
Level of scrutiny
Low. Test-only changes in test/regression/issue/ follow an established pattern in this repo. The tests are well-constructed: they use Promise.withResolvers() for deterministic control flow rather than timing-based sleeps, and the assertions correctly reflect spec-mandated LIFO sequential disposal semantics. The one Bun.sleep(0) per step is used only to drain microtasks after resolving a deferred promise, which is the standard idiom and not flaky.
Other factors
The bug-hunting system found no issues, CodeRabbit had no actionable comments, and the prior CI failures were confirmed as unrelated flakes (fixed on main by #29559) — robobun reports the new test file itself passed 4/4. There are no outstanding reviewer comments and no CODEOWNERS implications for a new test file.
c6a9ad2 to
dbbc50b
Compare
There was a problem hiding this comment.
LGTM — well-constructed regression tests with deterministic promise control, no production code changes.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, containing four regression tests for AsyncDisposableStack covering #29513 (disposeAsync not awaiting each resource's promise) and #24277 (use() not falling back to Symbol.dispose). Both bugs were already fixed by a JavaScriptCore upgrade; this PR only adds coverage to catch future regressions. No production/runtime code is touched.
Security risks
None. Test-only change with no I/O, no network, no filesystem, no auth/crypto surface.
Level of scrutiny
Low. This is a self-contained test file in test/regression/issue/. The tests are deterministic — they use Promise.withResolvers() to gate resolution explicitly rather than relying on timing/sleeps for correctness, and they assert exact event ordering per the TC39 explicit-resource-management spec (LIFO sequential disposal). The one Bun.sleep(0) is used only to flush microtasks after a manual resolve(), which is a standard pattern and not load-sensitive.
Other factors
- 4/4 tests pass locally under ASAN per the author's verification on the rebased HEAD.
- The CI failure (
fs.test.tson Windows) is a pre-existing regression from #29545's unified-sources change leakingS_IFBLK/S_IFSOCKdefines — unrelated to this test-only PR and reproduces on #29545's own CI. - No CODEOWNERS-sensitive paths, no outstanding human reviewer comments, and the bug-hunting system found no issues.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/regression/issue/29513.test.ts`:
- Line 51: The test uses timing-based scheduler yields (await Bun.sleep(0))
which makes it flaky; replace every call to Bun.sleep(0) in this test with a
deterministic microtask checkpoint such as await Promise.resolve() (or await new
Promise(r => queueMicrotask(r))) so the Promise.withResolvers sequencing remains
stable; search for the Bun.sleep(0) call sites in the test (the Bun.sleep call
expressions) and replace them with await Promise.resolve() to eliminate
setTimeout-style scheduling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e7717f9b-cf3d-4ad1-9d27-ddc32dadad1b
📥 Commits
Reviewing files that changed from the base of the PR and between c6a9ad21f5ff11e8e91ca629e08e62be915d67ff and dbbc50bfd6c12e215c73199fa5590fa41b2d7950.
📒 Files selected for processing (1)
test/regression/issue/29513.test.ts
dbbc50b to
b58bc82
Compare
There was a problem hiding this comment.
LGTM — test-only addition with deterministic assertions and no production code changes.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, containing four regression tests for AsyncDisposableStack behavior (sequential awaiting in disposeAsync() for use/adopt/defer, and the Symbol.dispose fallback). No production code is touched — both underlying bugs were already fixed by a prior JavaScriptCore upgrade (#28371), and this PR just locks in coverage.
Security risks
None. Pure test code with no I/O, no subprocess spawning, no network, no filesystem writes, and no external inputs. There is nothing security-sensitive here.
Level of scrutiny
Low. This is a self-contained test file in test/regression/issue/ following the repo's standard regression-test conventions. The tests use Promise.withResolvers() for explicit resolution control and Bun.sleep(0) as a macrotask barrier — the latter was questioned by CodeRabbit and convincingly justified (a single microtask hop is insufficient and would couple the test to JSC's internal .then() chain depth); that thread is resolved. No CODEOWNERS entry covers this path.
Other factors
The bug-hunting system found no issues. CI confirms 4/4 tests pass on the rebased HEAD, and earlier CI failures were confirmed unrelated (Windows fs.constants and install-test flakes, both fixed on main). The test logic correctly asserts LIFO ordering and that disposeAsync() remains pending until each disposer's promise resolves, which is exactly the spec behavior being guarded. Straightforward and low-risk.
The underlying JSC bug — GetDisposeMethod wrapped [Symbol.asyncDispose] in a closure that discarded the returned promise — was fixed upstream in WebKit and picked up in Bun 1.3.12 via the bump to fc9f2fa7 (#28371). This adds a regression test so a future WebKit update can't silently reintroduce the behavior. Covers use(), adopt(), and defer(); asserts LIFO ordering, that each disposer is fully awaited before the next begins, and that disposeAsync() does not resolve until all resources have finished disposing.
b58bc82 to
47e4e27
Compare
There was a problem hiding this comment.
LGTM — test-only regression coverage for already-fixed JSC AsyncDisposableStack bugs.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, containing four regression tests for AsyncDisposableStack behavior: sequential LIFO awaiting via use(), awaiting adopt() callbacks, fallback from Symbol.asyncDispose to Symbol.dispose (#24277), and awaiting defer() callbacks. No production/runtime code is modified — both underlying bugs were already fixed by a prior WebKit/JSC upgrade (#28371, Bun 1.3.12), and this PR just locks the behavior in.
Security risks
None. Test-only addition with no I/O, network, filesystem, or subprocess interaction; it exercises pure in-process JS semantics of a TC39 builtin.
Level of scrutiny
Low. The change is additive and isolated to test/regression/issue/. The tests are deterministic: they use Promise.withResolvers() to gate each disposal step and await Bun.sleep(0) only as a macrotask barrier to drain pending microtasks (not as a wall-clock wait). The Bun.sleep(0) concern raised by CodeRabbit was discussed inline and resolved — replacing it with Promise.resolve() would couple the test to JSC's internal .then() hop count and actually break the assertions.
Other factors
CI build #47212 passed on 266 jobs; the single failure (test-worker-nested-uncaught.js on x64-asan) is an unrelated worker-termination race, and the new test file passed in every shard that ran it. The bug-hunting system found no issues. The test logic correctly asserts LIFO ordering (r3→r2→r1), that disposeAsync() remains pending until each resource's promise resolves, and that sync-only disposables don't throw at use().
47e4e27 to
dad40ff
Compare
There was a problem hiding this comment.
LGTM — test-only regression coverage for an already-fixed JSC bug.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, containing four regression tests for AsyncDisposableStack behavior (use(), adopt(), defer(), and the Symbol.dispose fallback for #24277). No production/runtime code is touched — the underlying bugs were already fixed by a prior JavaScriptCore upgrade (#28371), and this PR only adds coverage to guard against future WebKit regressions.
Security risks
None. The change is pure test code: no auth, crypto, network, filesystem, or subprocess interaction. It exercises in-process JS spec behavior with synthetic resources built from Promise.withResolvers().
Level of scrutiny
Low. Test-only additions to test/regression/issue/ carry minimal blast radius — worst case is a flaky or incorrect test, not a runtime regression. The test design is deterministic (explicit deferred resolution + Bun.sleep(0) as a macrotask barrier rather than wall-clock waits), and the assertions match the TC39 DisposeResources spec (LIFO, sequential awaiting). The PR description verifies the tests fail on 1.3.11 and pass on 1.3.12+/HEAD, confirming they actually catch the regression.
Other factors
The only review feedback (CodeRabbit's suggestion to replace Bun.sleep(0) with Promise.resolve()) was discussed and resolved in-thread with a sound rationale, and CodeRabbit retracted. CI build #47212 is green aside from one unrelated worker-termination flake. The bug-hunting system found no issues. Given the small, self-contained, test-only scope with no outstanding reviewer concerns, this is safe to approve without further human review.
dad40ff to
115279e
Compare
There was a problem hiding this comment.
LGTM — test-only regression coverage for already-fixed JSC AsyncDisposableStack bugs.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, containing four regression tests for AsyncDisposableStack behavior (sequential LIFO awaiting in use()/adopt()/defer(), plus fallback to Symbol.dispose when Symbol.asyncDispose is absent). No production/runtime code is touched — both underlying bugs (#29513, #24277) were already fixed by the WebKit upgrade in #28371; this PR only adds coverage to guard against future JSC regressions.
Security risks
None. Pure in-process test code with no I/O, network, filesystem, subprocess, auth, or crypto surface. The tests construct plain JS objects and promises and assert on an event-order array.
Level of scrutiny
Low. Test-only addition under test/regression/issue/ with no CODEOWNERS coverage. The tests use Promise.withResolvers() for deterministic sequencing and Bun.sleep(0) as a macrotask barrier to drain the microtask queue — the latter was flagged by CodeRabbit but the author explained (and CodeRabbit accepted) that it is deterministic and avoids coupling to JSC's internal .then() hop count; that thread is resolved. The assertions match the TC39 explicit-resource-management spec semantics (synchronous start of the first LIFO disposer, each subsequent disposer beginning only after the prior one's promise settles).
Other factors
The author verified the tests fail on Bun 1.3.11 (reproducing both bugs) and pass on 1.3.12+, HEAD, and bun bd. CI history shows the new file passing in every shard that ran it; prior build failures were unrelated infrastructure/flake issues. No bugs were found by the bug-hunting system, and there are no outstanding unresolved review comments.
There was a problem hiding this comment.
LGTM — test-only regression coverage for already-fixed JSC bugs.
Extended reasoning...
Overview
This PR adds a single new file, test/regression/issue/29513.test.ts, containing four regression tests for AsyncDisposableStack: sequential LIFO awaiting via use(), adopt(), defer(), and the Symbol.dispose fallback path (#24277). There are zero changes to src/ — the underlying bugs were fixed by a prior WebKit upgrade (#28371), and this PR only locks in coverage.
Security risks
None. Pure test code exercising standard ECMAScript AsyncDisposableStack semantics in-process. No subprocess spawning, no network, no filesystem, no auth/crypto/permissions surfaces.
Level of scrutiny
Low. This is an additive, test-only change in test/regression/issue/. Worst-case failure mode is a flaky or incorrect test, not a runtime regression. The test design is deterministic (explicit Promise.withResolvers() gating each disposal step, Bun.sleep(0) as a macrotask barrier rather than a wall-clock wait), and the PR description documents verification on 1.3.11 (fails as expected) and 1.3.12+/HEAD (passes).
Other factors
- The only reviewer concern (CodeRabbit's suggestion to replace
Bun.sleep(0)withPromise.resolve()) was addressed with a correct rationale and the thread is resolved. - robobun reports 4/4 passing across all CI shards that ran the file in builds #47006–#51253.
- No prior
claude[bot]reviews exist on this PR. - File placement and naming follow the repo's
test/regression/issue/{N}.test.tsconvention.
|
Stale PR review: keep open, rework. The coverage is wanted. Main has no behavioural test for The location is the problem. Wanted shape:
|
Closes #29513
Closes #24277
What does this PR do?
Adds regression tests for
AsyncDisposableStack. Both underlying bugs were already fixed by a JavaScriptCore upgrade — this PR just adds coverage so a future WebKit bump can't silently regress them.Root cause
In the JSC shipped with Bun 1.3.0–1.3.11 (through oven-sh/WebKit@
00e8255),GetDisposeMethodwith an async-dispose hint had two bugs:(#29513) It wrapped the resource's
[Symbol.asyncDispose]in a closure:The returned promise from the real disposer was dropped on the floor, so
disposeAsync()chained on an already-resolved promise for every resource and finished in ~1ms regardless of how long each disposal actually took.adopt()'s closure had the same problem (() => { onAsyncDispose.call(undefined, value); }— block body, noreturn).(#24277) It checked
isCallablebefore checking forundefined/null:So passing a resource that only defined
[Symbol.dispose]threw instead of falling back to the sync method per GetDisposeMethod.Both were fixed upstream in WebKit/WebKit@92e52221d299 (the
await usingimplementation rewroteGetDisposeMethod) and landed in Bun via #28371, first released in 1.3.12.Verification
use,adopt, and sync-fallback cases)bun bdat HEAD — correct sequential LIFO disposal and sync-dispose fallback; regression tests pass (4/4)The tests use
Promise.withResolvers()to control resolution explicitly (no timing-based waits) and assert that each resource's disposal completes before the next begins and before the overalldisposeAsync()promise resolves.