Repository navigation
test(updates): use atomic records in watchdog fixtures - #584
Merged
Merged
Conversation
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
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 chained-update watchdog test intermittently exposed an empty or partially written
.update.jsonthrough shell>redirection. CI run 43270195463, attempt 2, failed withSyntaxError: Unexpected EOFinreadUpdateRecord. The production writer has used a private temporary file, filefsync, and atomic rename since its introduction; the failing fixture bypassed it.The v2 and v3 fixtures now call the real
confirmStartupandstageBinaryUpdateAPIs. 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 ofTMPDIR=/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-widebun run lintandbun 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