Repository navigation
test(ui-server): restore Git cancellation fixtures after timeouts - #2611
Merged
Merged
Conversation
This was referenced Oct 22, 2026
schlessera
marked this pull request as ready for review
October 22, 2026 10:03
6 of 8 tasks
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.
Closes #2552
What changed
Cancellation fixtures restore their Git lookup and maintenance-worker spies from synchronous
afterEachcleanup before deleting fixture directories, as well as from an idempotentfinally. The unnecessary process-widePATHoverride is gone. Child-process controls exercise bothduringandaftercases with an induced timeout, then verify real Git resolution, original PATH/function identities, and a late callback unwind while the next case owns its own spies.Why this shape
Bun can time out an async callback and run
afterEachwhile itsfinallyis still suspended. Registering restoration on the existing cleanup stack makes it independent of that callback settling and preserves cleanup ordering. The controls suspend a disposable copy of the actual cancellation callback before native work, retaining its setup, spies and teardown. They keep the normal maintenance execution and cancellation assertions unchanged.Audited
process.env.PATHwrites andBun.whichspies throughout ui-server/ui-sdk tests. The four other lookup-spy sites (worker-output-budget,worker-filesystem-filter,worker-launcher,worker-host-refusal) restore synchronously without awaited work. No other matching instance needed changes.Proof
Head:
4b1e74cdc62bf8e7911729d2e6e319bfeb163d44.Base:
55108a63255d82d98822093db3cc3b90a858e03a.trystatement with a 250 ms test timeout, logged real Git forduring, then the deletedodysseus-maintenance-*/gitshim forafter. The following original case failed withENOENTat its Git initialization, matching the reported CI sequence.cleanup.push(restore)makes both regression controls fail. The child assertions areFOLLOWING_CASE_REAL_GITforduringandFOLLOWING_CASE_ORIGINAL_MAINTENANCE_WORKERforafter; late-finally checks also detect the still-active prior spies. Restoring registration passes both controls (2 tests, 18 parent assertions).bun run test packages/ui-server/tests/maintenance-startup-view.test.ts: five consecutive standalone runs, each 27 pass / 0 fail, in addition to combined/preflight runs.bun run test packages/ui-server/tests/maintenance-startup-view.test.ts packages/ui-server/tests/maintenance-cancellation-cleanup.test.ts: 29 pass / 0 fail.bun run lintandbun run typecheck(tsc --noEmit): passed.bun run check:pr --base origin/main: passed, including 29 pass / 0 fail affected tests.4b1e74cdc62bf8e7911729d2e6e319bfeb163d44, treec9e43d7d54dd88503d9c5e508c92cb0ae9e9a35d, parent55108a63255d82d98822093db3cc3b90a858e03a. JUnit/timing reports matched the complete three-file inventory. Command:The worker split uses the ordinary copied-storage unit fixtures; native Btrfs qualification is separate.
Checklist
docs/reflect the change, or nothing documented moved.docs/decisions/provider-history.md): the provider-history guard passes, or nothing on a turn's path changed.No changeset: this changes tests only; no packed source, contract, documentation or provider-facing history changes.
Anything left open
Coordinator-owned ready-candidate confirmation and merge. This PR remains a draft under the worker brief; no ready transition, confirmation or merge is requested here. Local preflight and two-worker receipts are recorded above. Main advanced during verification (including app-state isolation in #2377); these receipts establish the recorded parent/head, and do not claim proof for a later combined tree. The coordinator owns refresh/confirmation for the integration candidate.