[PR #662] [MERGED] test(hopper): synchronize startup cancellation with launcher readiness #2145

Closed
opened 2026-10-16 21:14:52 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/662
Author: @N0zoM1z0
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @N0zoM1z0

Base: main ← Head: test/fix-hopper-startup-cancellation-race


📝 Commits (1)

  • dd57352 test(hopper): synchronize startup cancellation with launcher readiness

📊 Changes

1 file changed (+47 additions, -8 deletions)

View changed files

📝 tests/boundary/providers/hopper/hopperClient.startupFailures.test.ts (+47 -8)

📄 Description

Change

Synchronize the Hopper startup cancellation test with the first launcher returning its owned child process. The old 10ms timer could cancel runtime-directory creation before launch() ran; the retry then consumed the deliberately silent first launcher and timed out after 30 seconds.

Keep the prompt cancellation assertion and verify the cancelled child has exited. Cover the other ordering separately: cancellation before launch must create no child, and retry must complete health and echo requests.

Production behavior, test retries, and timeout limits are unchanged.

Evidence and verification

  • Main CI run 37419207202, shard 4: the retry in cancels bridge startup without waiting for the startup timeout failed with HopperTimeoutError after 30000ms. Coverage aggregation failed because the shard failed.
  • Reproduced the same failure locally by cancelling the already initiated startup synchronously, before its asynchronous directory creation completed. Used a 250ms deadline for that temporary diagnostic experiment; restored the original file before the fix.
  • npm run test:focused -- tests/boundary/providers/hopper/hopperClient.startupFailures.test.ts tests/boundary/providers/hopper/hopperClient.restart.test.ts tests/boundary/providers/hopper/hopperClient.cleanup.test.ts tests/boundary/providers/hopper/hopperClient.protocol.test.ts tests/boundary/providers/hopper/hopperClient.progress.test.ts: 44 tests passed.
  • Repeated npm run test:ci:shard:run -- tests/boundary/providers/hopper/hopperClient.startupFailures.test.ts --shard=1/1 three times: 17 tests passed in every run, with the CI coverage instrumentation and shard threshold policy.
  • npm run check:fast, focused Oxfmt check, and git diff --check: passed.

These are real subprocess/socket boundary fixtures. Real Hopper/Ghidra verification was not performed; this change affects only the test fixture's cancellation ordering.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/662 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `test/fix-hopper-startup-cancellation-race` --- ### 📝 Commits (1) - [`dd57352`](https://github.com/morluto/rea/commit/dd5735241b2dc31d8a241997e91b6d61f83013aa) test(hopper): synchronize startup cancellation with launcher readiness ### 📊 Changes **1 file changed** (+47 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/providers/hopper/hopperClient.startupFailures.test.ts` (+47 -8) </details> ### 📄 Description ## Change Synchronize the Hopper startup cancellation test with the first launcher returning its owned child process. The old 10ms timer could cancel runtime-directory creation before `launch()` ran; the retry then consumed the deliberately silent first launcher and timed out after 30 seconds. Keep the prompt cancellation assertion and verify the cancelled child has exited. Cover the other ordering separately: cancellation before launch must create no child, and retry must complete health and echo requests. Production behavior, test retries, and timeout limits are unchanged. ## Evidence and verification - Main CI run [37419207202](https://github.com/morluto/rea/actions/runs/37419207202), shard 4: the retry in `cancels bridge startup without waiting for the startup timeout` failed with `HopperTimeoutError` after 30000ms. Coverage aggregation failed because the shard failed. - Reproduced the same failure locally by cancelling the already initiated startup synchronously, before its asynchronous directory creation completed. Used a 250ms deadline for that temporary diagnostic experiment; restored the original file before the fix. - `npm run test:focused -- tests/boundary/providers/hopper/hopperClient.startupFailures.test.ts tests/boundary/providers/hopper/hopperClient.restart.test.ts tests/boundary/providers/hopper/hopperClient.cleanup.test.ts tests/boundary/providers/hopper/hopperClient.protocol.test.ts tests/boundary/providers/hopper/hopperClient.progress.test.ts`: 44 tests passed. - Repeated `npm run test:ci:shard:run -- tests/boundary/providers/hopper/hopperClient.startupFailures.test.ts --shard=1/1` three times: 17 tests passed in every run, with the CI coverage instrumentation and shard threshold policy. - `npm run check:fast`, focused Oxfmt check, and `git diff --check`: passed. These are real subprocess/socket boundary fixtures. Real Hopper/Ghidra verification was not performed; this change affects only the test fixture's cancellation ordering. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:52 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2145
No description provided.