Skip to content

test(updates): use atomic records in watchdog fixtures - #584

Merged
nixuuu merged 1 commit into
devfrom
fix/updater-watchdog-flake
Nov 12, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/updater-watchdog-flake

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026

Copy link
Copy Markdown
Member

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

The chained-update fixture wrote update.json with shell redirection, exposing an empty or partial record to the supervisor. Exercise the production confirmation and staging APIs instead, and cover a paused half-written replacement plus fail-closed reads of a torn authoritative record.

Related: #10
Related: #582
@nixuuu
nixuuu merged commit ac2d205 into dev Nov 12, 2026
15 of 17 checks passed
@nixuuu
nixuuu deleted the fix/updater-watchdog-flake branch November 12, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant