Repository navigation
test: cover the River stale-snapshot restore and receive-pack's lenient hydrate - #775
Conversation
…nt hydrate probe that the tests did not keep: - TestPushRunStaleHeldSnapshotRiverRestoreFailures: a River push run whose loopback fetch is refused for a stale held ref fails when its RestorePush fails, and its error is ErrShutdown when a shutdown lands during the restore, failing or not. Mutants W6, W7 and W8 (worker_push.go: return nil, or drop shutdownErr) now fail it. - TestServerHydrate_ReceivePackWithClaimIsLenient: a receive-pack whose token carries a sync claim reuses the held-skip verdict and does not scan the authority again. The mutant that drops service == "upload-pack" from hydrate's strict rule now fails it. - TestRiverForwardHeldStaleRefRestores: the verifier's PostgreSQL probe, the end-to-end replay of the stale held snapshot on River's wiring. It shares its body with TestLocalForwardHeldStaleRefRestores. Change-Id: I08d0da600391204f8dd9ee0f048e2234533c3480 Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Why
#762's verifier passed it with three test gaps. Each one let a mutant survive, or left a probe out of the repository:
worker_push.go, the restore after a refused loopback fetch) had no test for a failingRestorePushor for a shutdown during the restore. Three mutants survived: W6 returns nil after a failed restore, W7 dropsshutdownErraround the restore error, and W8 drops it around the run's error.service == "upload-pack" && claims.SyncClaim != "". A mutant that drops the service check survived: a receive-pack with a sync claim gives the same error either way, because receive-pack tolerates ref-sync failures.This PR changes tests only.
What changes
TestPushRunStaleHeldSnapshotRiverRestoreFailures(internal/sync) refuses the loopback fetch with 423 and wraps the store'sRestorePush. It checks three cases:ErrShutdown, which keeps the job for the next process.ErrShutdown, and the force request is handed back with no counted run.TestServerHydrate_ReceivePackWithClaimIsLenient(internal/githttp) sets up a held-skip verdict for a stale held ref. A receive-pack with a sync claim must reuse that verdict (no new scan of the authority's refs), and an upload-pack with the claim must scan.TestRiverForwardHeldStaleRefRestores(internal/githttp, PostgreSQL only) is the verifier's probe. It shares its body withTestLocalForwardHeldStaleRefRestores(forwardHeldStaleRefRestores), which leaves out the local lanes for River. On River, the first run must return an error and hand its request back with no counted run. The lane then settles with the upstream at the REST write's commit. It callsWorker.RunPushdirectly with PostgreSQL stores and no local lanes, so it pins the worker's River branch. River's own job handling (the snooze after the error) is not part of this test.No covered production file changes, so the verify-lane-schedule fingerprints and the SKILL.md sync line stay as they are.
Verification
Mutants, each applied alone:
S1 was already red in older tests (
TestServerHydrate_StrictOnlyForPushRunFetch,TestServeStrictSyncFetch,TestLocalForwardHeldStaleRefRestores). This PR adds its red on the River branch. S2 is the mutant that no test caught before.Lanes at ad2c112, each test lane under the host's shared heavy-validation lock:
go build ./...,go vet -tags=openstorage_viewcheck ./...and golangci-lint: pass, 0 issues.check.sh --fingerprints-only:RESULT: PASS.go test ./internal/sync -raceon PostgreSQL, local and S3-WAL: ok.go test ./internal/githttp -race -run 'TestServerHydrate_|TestHydrateStrictHeld|TestLocalForwardHeldStaleRefRestores|TestRiverForwardHeldStaleRefRestores|TestServeStrictSyncFetch'on PostgreSQL, local and S3-WAL: 5 pass and 1 skip on each. The skip is the other schedule's replay:TestLocalForwardHeldStaleRefRestoresskips on PostgreSQL, andTestRiverForwardHeldStaleRefRestoresskips on local and S3-WAL.go vetofinternal/githttpandinternal/syncpasses on that merge, with and without the viewcheck tag.Size
155 changed lines, all tests.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh