Repository navigation
test(vault): take the orphan blob's age in TestPrune from the test clock - #240
Merged
Merged
Conversation
TestPrune's clock starts on 2026-10-16 and moves 31 days, but the orphan blob it makes got the real modification time. The daily prune keeps an orphan younger than a day (docs/specs/sync-protocol.md, Blobs), so from 2026-11-15 09:30 UTC the orphan looked young and the test failed on main. The test now sets the orphan file's times to the test clock.
Contributor
Author
|
Cross-review (reviewer openai/gpt-6.1-sol; coder deepseek/deepseek-flash) at 7d8ba6a, base 6c33227: Ready, Blocking: none, no findings. The reviewer confirmed the root cause (test clock ends 2026-11-16 09:30 UTC, orphan cutoff 2026-11-15 09:30 UTC), the blob path, and that the other asserted blobs (v1, v2, gone freed by the version prune; v3 referenced) do not depend on file times. |
bketelsen
approved these changes
Nov 15, 2026
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.
Summary
TestPrune(internal/vault/write_test.go) fails onmainsince 2026-11-15 09:30 UTC, in Verify and in the race detector (CI run 43716324908):write_test.go:395: blob 5134638c kept = true, want false.The cause is a time bomb in the test. The test vault's clock starts at
testStart(2026-10-16 09:30 UTC) and the test moves it 31 days. The orphan blob that the test makes got the real modification time of its file.Manager.Prunekeeps an orphan blob whose file is younger than a day by the configured clock (internal/vault/manager.go, the wait for a device's push, docs/specs/sync-protocol.md, Blobs). Once the real date passed the test clock's "now minus 24 hours", the orphan looked young and was kept.The test now sets the orphan file's times to the test clock, so the orphan is 2 days old at the prune whatever the real date is. Every assertion stays the same. No production code changes.
Risk tier
Risk tier: 1 — a test change only (
internal/vault/write_test.go). No changed file is in.github/risk-paths.json.Verification
go test -count=40 -run 'TestPrune$' ./internal/vaultonmain(6c33227): 40 of 40 runs fail atwrite_test.go:395.go test -count=20 -run 'TestPrune$' ./internal/vault: ok;go test -race -count=1 ./internal/vault: ok.make check(host,umask 022) at the head: exit 0.write_test.go:395(blob 5134638c kept = true, want false), the failure onmain.