Repository navigation
test(core): wait for fake stop handlers before reaping - #281
Merged
Merged
Conversation
The reap order test waited a fixed 100 ms before it signaled the fake browser, VNC and Xvfb processes. Under load, Node startup can take longer, so the reaper sent SIGTERM to the browser group before its handler existed and the fake died without a record. Each fake now writes a ready file after it installs its SIGTERM handler, and the test waits for all three before it reaps. Closes #265
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the reap-order flake in
packages/core/test/session.test.ts. The cause was in the test, not the product.Each fake process is a
node -escript that installs its SIGTERM handler only after Node starts up. The test waited a fixed 100 ms before reaping. Under load, Node startup took 90 to 140 ms, so the reaper sometimes signalled the fake browser before its handler existed. The default action killed it before it wrotebrowserto the order file, which gave[vnc, xvfb]. Each fake now writes a ready file right after it installs its handler. AwaitForReadyFileshelper replaces the fixed delay, polls every 10 ms with a 10 s limit, and fails at once if a fake exits early. The order assertion is unchanged.[browser, vnc, xvfb]kept; only setup changedbun run lint,bun run typecheck,bun run build,bunx vitest run packages/core test/security(1271 passed); PickCheck no new or worsened violationsQA pass skipped: this is a test-only change with nothing to drive.
Closes #265