Skip to content

test: remove parent IPC delay from abandoned-entry gate - #856

Merged
agenteinstinct1-max merged 4 commits into
dev-vibecodedfrom
fix/abandoned-entry-local-gate-609
Nov 18, 2026
Merged

agenteinstinct1-max merged 4 commits into
dev-vibecodedfrom
fix/abandoned-entry-local-gate-609

Conversation

@agenteinstinct1-max

@agenteinstinct1-max agenteinstinct1-max commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Issue for this PR

Closes #857

Refs #609. This addresses the abandoned-entry fixture latency cascade only and does not claim to close the broader issue.

Type of change

  • Bug fix

What does this PR do?

Refs #609. Removes the parent stderr/stdin round trip from the abandoned-entry regression fixture. That round trip can leave the next test's entry hook waiting on the deliberate cleanup gate until its own timeout, skipping the body that checks restored state.

A test-only preload now registers an early beforeEach before importing the unchanged real entry barrier. On the second test it schedules gate release with setImmediate. This happens after Bun cuts off the first cleanup hook, but does not itself wait for finalization. The real barrier must still join the abandoned scope before the plain test body enters.

The child runs from a fresh temporary directory with explicit preloads, so the package bunfig cannot register the real barrier ahead of the early release hook. The temporary directory is removed after the child exits.

Coverage retained

  • The original expected host timeout and cleanup-hook cutoff.
  • Finalizer completion, child interruption/join, restored environment and zero in-flight owned runs before the next plain test body.
  • No late overwrite of the newer test's environment or event state.
  • Unchanged 800ms child timeout and 15-second child guard.
  • No production, CI, workflow or Turbo changes.

Adds a negative control that omits the real entry barrier. It must observe the plain body entering with the old active environment and one in-flight run before finalizer release. This checks that the new release hook does not make the real barrier unnecessary.

Verification and acceptance

Bun 1.3.14. Current reviewed head: 6747e106ee374669a9400b558f05c9762b01cbd1, qualified into dev-vibecoded base 3dd313a43ca5344394ebe1103ef071a901473203.

  • Linux focused positive and discriminating negative control: 2 pass, 16 assertions. Adjacent abandoned-run matrix: 1 pass, 111 assertions.
  • Current Linux full suite: 5168 tests across 348 files, 0 failures; all 7 Turbo tasks successful. Generated-client check and HttpApi exerciser gates passed.
  • Current Windows full suite: 5162 pass, 61 skip, 1 todo, 0 fail; 5224 tests across 348 files, 22761 assertions; all 7 Turbo tasks successful, 0 cached. Unit step took 36m04s within its unchanged budget. Generated-client and HttpApi steps are Windows-skipped under the existing workflow, not Windows coverage.
  • Both parent barrier cases are unconditional, with no Windows skip. CI uses --only-failures, so passing test names and child traces are not printed. The raw suite result does not provide a separate passing C2/C3/C4 timeline.
  • Current required typecheck, standards and compliance passed. Clean Kilo review covers the original full diff and subsequent incremental changes. The earlier local default-heap typecheck did not complete; no local success or repeated OOM claimed.
  • Formatting and git diff --check passed. No production, CI, workflow, Turbo, assertion or timeout-budget changes.

Windows repair and limits

Failure-only phase evidence localized the earlier Windows hang after first-test body and finalizer entry, with preload imports complete. The fixture body live handle had already cleared before the outer finalizer waited on the promise gate. The repair owns an empty interval across that wait via Effect.acquireUseRelease, reusing the tracked handle helper and afterAll fallback. The interval does not release the gate, add a sleep, delay cleanup or extend a budget. Current Windows qualification passes; this is not proof of a general Bun defect.

The unchanged real barrier must still join the abandoned scope after the cutoff before the next plain body enters. The negative control omits that barrier and requires early entry with active old environment and one in-flight run. Original restoration, child join, event-order and no-late-overwrite assertions remain.

This closes narrow fixture issue #857 only. Broader #609 and separate #858/#859 remain open.

Windows run: https://github.com/mdev34-lab/silvercode/actions/runs/44290557060/job/134754391972
Linux run: https://github.com/mdev34-lab/silvercode/actions/runs/44290557060/job/134754392329
Review: #856 (comment)

Checklist

  • Tested locally and qualified in current-head CI
  • No unrelated changes included

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@kilo-code-bot

kilo-code-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier.ts
  • packages/opencode/test/lib/fixtures/abandoned-keepalive.ts

Notes: Incremental diff (a44cd27..HEAD) extracts startLiveHandle/stopLiveHandle from abandoned-keepalive.ts and wraps the abandoned-scope finalizer body in Effect.acquireUseRelease so the live interval handle is cleared on interruption. No new correctness, security, or runtime issues found in changed code.

Previous Review Summaries (3 snapshots, latest commit a44cd27)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit a44cd27)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files changed in incremental diff)
  • packages/opencode/test/lib/abandoned-entry-barrier.test.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-gate.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-no-barrier-preload.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-phase.ts - No issues (new)
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-preload.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier.ts - No issues

Notes: Incremental diff (64e84e39..a44cd27) adds bounded, failure-only phase tracing to aid Windows qualification of the existing abandoned-entry barrier test/fixtures. No new correctness, security, or runtime issues found in changed code. Verification remains as stated in PR (Linux positive/negative coverage passed; Windows/CI qualification pending). No inline comments posted.

Previous review (commit 64e84e3)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file changed in incremental diff)
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-preload.ts - No issues
Previously Reviewed Files (unchanged since last review)
  • packages/opencode/test/lib/abandoned-entry-barrier.test.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-gate.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-no-barrier-preload.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier.ts - No issues

Previous review (commit 8d59f68)

Status: No Issues Found | Recommendation: Merge

Reviewed commit 8d59f68060991d5916acb902eda534898ce0a8ab (test-only changes to the abandoned-entry barrier fixture/harness).

Files Reviewed (5 files)
  • packages/opencode/test/lib/abandoned-entry-barrier.test.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-gate.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-no-barrier-preload.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier-preload.ts - No issues
  • packages/opencode/test/lib/fixtures/abandoned-entry-barrier.ts - No issues

Validation notes: This was a static, read-only review of the PR diff and touched test/fixture files. I did not run tests, lint, or typecheck (package tsc --noEmit noted as incomplete in PR description). No inline comments posted.


Reviewed by free · Input: 27.5K · Output: 11.2K · Cached: 160.8K

@agenteinstinct1-max
agenteinstinct1-max merged commit 1028e68 into dev-vibecoded Nov 18, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant