Repository navigation
test(computers): serialize pairing fixture startup - #582
Merged
Merged
Conversation
nixuuu
marked this pull request as ready for review
November 12, 2026 18:01
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
The chained-update watchdog test intermittently exposed an empty or partially written `.update.json` through shell `>` redirection. CI run 43270195463, attempt 2, failed with `SyntaxError: Unexpected EOF` in `readUpdateRecord`. The production writer has used a private temporary file, file `fsync`, and atomic rename since its introduction; the failing fixture bypassed it. The v2 and v3 fixtures now call the real `confirmStartup` and `stageBinaryUpdate` APIs. A deterministic write barrier pauses the real confirmation writer after half its bytes and checks that readers still see the previous pending record, then the complete confirmation. A torn authoritative JSON regression checks that corruption remains an error. No read retries or updater/protocol behavior changes are needed for this failure. The frozen update protocol is untouched. Validation: Bun 1.4.4; `bun install --frozen-lockfile`; 10 consecutive separate executions of `TMPDIR=/var/tmp nice -n 19 bun test packages/updater/src/binary.test.ts` (8 tests each, 80 passes, 0 failures, about 4 seconds total); repository-wide `bun run lint` and `bun run format:check`; `git diff --check`. Generation, typecheck, the full test/temp checks, and builds are left to CI under the local verification constraints. CI repetition is pending. History: #10 introduced the shell fixture; this test-only correction uses `Related:` so it does not trigger a release/promotion hold. Related: #10 Related: #582
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.
The pairing suite could leave a deliberately persisted
pairing_requireduntouched when restoring the original peer. Its shared fixture starts the runtime before the listener (tests/integration/support/computers.ts:42), so a startup dial races the listener's first address announcement. That announcement retires sockets and aborts dials (apps/gateway/src/computers/runtime-lan.ts:51). The suite's single reconnect tick can observe the closing incoming connection and skip dialing (apps/gateway/src/computers/runtime-connection.ts:149); its next automatic retry is deliberately 60 seconds away, beyond the 5-second assertion window.This is fixture timing. The #579 failure occurs in
restoreB(), after the test intentionally setspairing_required, not in shared setup or a previous test. The failed job shows two expectedserver_pin_mismatchprobes followed by an aborted startup connection and no subsequent successful handshake. Self-heal writesconnectedonly after a successful pinned handshake (apps/gateway/src/computers/runtime-frames.ts:316–321). There is no evidence here of that write being overwritten.Pause dialing during fixture startup until its listener and initial address publication have completed. Explicit ticks then establish links, and shared setup/recovery wait for each gateway's own committed connected status. Preserve the cross-version metadata barrier, remove its route-deletion workaround, and extend the persisted-state recovery case with a barrier holding listener startup open.
Validation:
TMPDIR=/var/tmp nice -n 19 bun run check:tmp ./tests/integration/linked-pairing-recovery.test.ts: 10 passed, 0 failed each time (50 test executions), each about 4.4 seconds; every temp-directory check passed.git diff --checkpass. No other local tests run.Related: #573
Related: #575
Related: #579