Skip to content

test: select the actual Vitest runner for GC barriers - #655

Draft
bubkoo wants to merge 1 commit into
masterfrom
codex/gc-runner-frame-controls
Draft

bubkoo wants to merge 1 commit into
masterfrom
codex/gc-runner-frame-controls

Conversation

@bubkoo

@bubkoo bubkoo commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

The browser provider's frame helper waits for any frameattached event when the named Vitest runner is absent. A private source/probe iframe can win that race. The GC barrier then evaluates the wrong context or throws Frame was detached when the private iframe is removed.

Resolve the actual iframe[data-vitest="true"] element's contentFrame instead, and dispose its temporary ElementHandle before requesting GC. Keep the original 1000 ms frame-selection deadline and the existing GC/evaluation sequence. Production sources, dependencies, assertions, timeouts, browser flags and the three collection calls in each lifecycle test are unchanged.

Five identical real Chromium scenes compare the installed provider/original adapter with this adapter (10 executions). Independent DOM frame identity verifies the selected runner. Cases cover an existing runner, private frames arriving before a later runner, no runner ever arriving, and removal of an already selected real runner. The candidate waits for the correct runner, rejects a missing runner at the original deadline, releases all four acquired handles before GC, and still throws the original error when the real runner is detached. Earlier provider failures, private-frame false success and the initial harness import error remain evidence.

Local validation on master f8d1c4b: lint, build, browser types and installed ESM/CJS/UMD/TS4.9/current consumers pass; full default tests pass 1234 coverage / 1115 source (4 inherited skips each); all 162 built-package browser tests pass. All 284 measured inputs remain stable. Browser package services use separate loopback ports and have stopped.

This repairs the independently reproduced frame-selection defect. It does not establish that the earlier project Frame was detached error used this path, and it does not claim to fix #650's wider source-document GC failures. Current-head remote results for 5fcd839f79cef79d240c748f5ceeac7e21a08d63: CI run 45491737937 failed; CodeQL passed. Coverage passed 1234 tests with 4 skips; source tests passed 1112 with 3 Firefox failures and 4 skips, all in resource-resolver-cancellation.test.ts. The probed=false case fails at line 111 with nativeCollected=true, ownerCollected=false; probed=true fails there with both values false, before the native assertion at line 112. The pending custom-font resolver case fails its collection assertion at line 202. Its nativeRetention flags use !!WeakRef.deref(): plain/sharedFonts=false means collected, while nativeProbe/measuredProbe=true means retained; InvalidModificationError is also reported. Built-package tests and Codecov were skipped after the source failure. These outcomes neither establish a common retaining owner nor replace the independent frame-selection controls above. Failing job and original diagnostics and published exact-head failure evidence. Keep this draft.

docs/evidence/gc-runner-frame-controls.json, the 43-member raw archive, SHA index and portable verifier preserve the original and candidate implementations, actual identity/handle/GC observations and complete logs. No npm publication, old contributor-PR closure or Mac network configuration change.

This branch has not been deployed

No deployments
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