Drop values staticcheck SA4006 finds assigned and never read
Mechanical: every value here is overwritten or dropped before anything reads it, so removing it changes no behaviour. Production (9 sites): deploy.go's second instance count; settleRelease's first deadline; the managed worker's first box list (re-read after preparation); reconcile's app from appKeyOwner (canaryPointer returns the same one); the mail gate fence's new tag (step 4 re-reads the gate); the participant's claim after counting; the first slice in startGen and the rootfs start (read only on the reload path); and the replica placement worker's publish error, which publishCurrent already reports as done == false, now discarded explicitly with a comment. Tests: leftover assignments removed. In the parked moves tests a context made before skipParkedSecretFlow now comes after it; two values that must be taken before the skip (residue planted, inputs pinned) carry a //lint:ignore SA4006 saying they are read once the skip comes off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 files changed,
+80
−75
deploy.go+1 −1internal/activator/replica_reconcile_wake_test.go+1 −1internal/activator/rootfsrelease.go+2 −2internal/console/apiinstancemove_test.go+0 −1internal/console/apirunsbox_test.go+1 −1internal/console/demo_claim_dev_test.go+1 −1internal/console/managedbudget_test.go+2 −2internal/console/managedenrol_test.go+2 −2internal/console/managedrecovery_test.go+1 −1internal/console/managedworker.go+2 −2internal/console/managedworker_test.go+6 −6internal/console/overview_test.go+1 −1internal/domains/freshdns_test.go+2 −2internal/domains/reconcile.go+1 −1internal/host/claimmoveaccess_test.go+1 −1internal/host/claimservingpark_linux_test.go+2 −1internal/host/claimstop_writers_rev4_linux_test.go+0 −1internal/host/link_sim_test.go+1 −1internal/host/movesbuildstatepark_test.go+1 −0internal/host/movesfileslive_test.go+2 −2internal/host/movesinstall_test.go+1 −0internal/host/movesland_test.go+5 −5internal/host/movesloss_test.go+3 −3internal/host/movesrecover_test.go+1 −1internal/host/movesrecoveryowners_test.go+1 −1internal/host/movesrollback_test.go+5 −5internal/host/movesrollback_witness_test.go+1 −1internal/host/moveswakesource_linux_test.go+1 −1internal/host/plan14_fix5_live_linux_test.go+1 −1internal/host/plan14_root_failures_root_linux_test.go+1 −1internal/host/replicaplacement.go+3 −1internal/host/runs_test.go+3 −3internal/hostops/mail_reconcile.go+3 −1internal/hostrelocate/participant.go+1 −1internal/instancectl/gen.go+2 −1internal/instancectl/rootfs.go+1 −1internal/mail/walk_environment_test.go+2 −2internal/maintenanceguard/guard_test.go+2 −2internal/objstore/queue_test.go+1 −2internal/provision/census_propose_internal_test.go+2 −2internal/provision/replicaassignment_test.go+6 −6internal/provision/replicadeploy_test.go+3 −3internal/registry/links_writers_test.go+1 −1
diff --git a/deploy.go b/deploy.go| index 801f188f7..1ef7d5b35 100644 |
| --- a/deploy.go |
| +++ b/deploy.go |
| @@ -485,7 +485,7 @@ func runDeploy(args []string) { |
| } |
| if len(envSet) > 0 { |
| if staticDeploy && *hostFlag != "" { |
| - recs, truncated, total, err = sess.instanceList(ctx, acct, *app, "", "") |
| + recs, truncated, _, err = sess.instanceList(ctx, acct, *app, "", "") |
| if err != nil { |
| log.Fatalf("deploy: list instances: %v", err) |
| } |
diff --git a/internal/activator/replica_reconcile_wake_test.go b/internal/activator/replica_reconcile_wake_test.go| index 51c43578e..f7ee5ed1c 100644 |
| --- a/internal/activator/replica_reconcile_wake_test.go |
| +++ b/internal/activator/replica_reconcile_wake_test.go |
| @@ -111,7 +111,7 @@ func TestReplicaReconcileMemberWakeVerifiesGeneration(t *testing.T) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - recp, err = provision.ClearRecordReplicaAssignment(writeCtx, store, id, replicas.Expect{Incarnation: inc, Region: recp.Region, RecordSeq: recp.RecordSeq, Revision: recp.ReplicaAssignment.Revision}) |
| + _, err = provision.ClearRecordReplicaAssignment(writeCtx, store, id, replicas.Expect{Incarnation: inc, Region: recp.Region, RecordSeq: recp.RecordSeq, Revision: recp.ReplicaAssignment.Revision}) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/activator/rootfsrelease.go b/internal/activator/rootfsrelease.go| index ae8280aeb..d064282e4 100644 |
| --- a/internal/activator/rootfsrelease.go |
| +++ b/internal/activator/rootfsrelease.go |
| @@ -666,14 +666,14 @@ func (a *Service) settleRelease(op *releaseOp) error { |
| defer cancel() |
| return op.hold.stop(sctx, reason) |
| } |
| - tripped, deadline := op.trippedAt() |
| + tripped, _ := op.trippedAt() |
| reason := "" |
| if tripped { |
| reason = StopLeaseLost |
| } |
| err := attempt(reason) |
| for err != nil { |
| - tripped, deadline = op.trippedAt() |
| + tripped, deadline := op.trippedAt() |
| if !tripped || deadline.IsZero() || !time.Now().Add(releaseSettleRetry).Before(deadline) { |
| return err |
| } |
diff --git a/internal/console/apiinstancemove_test.go b/internal/console/apiinstancemove_test.go| index 29fd5a3bb..c5e20daac 100644 |
| --- a/internal/console/apiinstancemove_test.go |
| +++ b/internal/console/apiinstancemove_test.go |
| @@ -1384,7 +1384,6 @@ func TestMoveDoorGateSentences(t *testing.T) { |
| check("instance GET, ambiguous account", http.MethodGet, u+"/st.go.tito.io", "", http.StatusConflict, ambiguousLegacy) |
| check("channels GET, ambiguous account", http.MethodGet, fx.ts.URL+"/api/cli/apps/bab/titogo/channels", "", http.StatusConflict, ambiguousLegacy) |
| check("app create, ambiguous account", http.MethodPost, fx.ts.URL+"/api/cli/apps/bab/new", `{"name":"other"}`, http.StatusConflict, ambiguousLegacy) |
| - u = u + "?exact=sqid" |
| // The shared instance gate: the rate limit, spent last. |
| for i := 0; i < cliInstanceBurst; i++ { |
| fx.srv.cli.instances.allow(hashToken(token), time.Now()) |
diff --git a/internal/console/apirunsbox_test.go b/internal/console/apirunsbox_test.go| index 52674eef5..2f9ce045f 100644 |
| --- a/internal/console/apirunsbox_test.go |
| +++ b/internal/console/apirunsbox_test.go |
| @@ -689,7 +689,7 @@ func TestRunRelayRequestBudget(t *testing.T) { |
| runChunk(t, ws, 2, runs.StreamOut, []byte("two\n")) |
| runEndAck(t, ws, runs.Result{Box: "box-a", LastSeq: 2}) |
| fx.srv.runRelays.relays.Wait() |
| - got := counts{} |
| + var got counts |
| stable := time.Now().Add(5 * time.Second) |
| for { |
| mu.Lock() |
diff --git a/internal/console/demo_claim_dev_test.go b/internal/console/demo_claim_dev_test.go| index c607a284e..38bd02f29 100644 |
| --- a/internal/console/demo_claim_dev_test.go |
| +++ b/internal/console/demo_claim_dev_test.go |
| @@ -113,7 +113,7 @@ func TestDemoClaimDevAcceptance(t *testing.T) { |
| if cfg.AccountID == "" { |
| t.Fatal("fixture requires exact account selection") |
| } |
| - code, body, _ = request("POST", cfg.Console+"/api/demo/claims/select", "", map[string]string{"flowToken": flow, "accountId": cfg.AccountID}) |
| + code, _, _ = request("POST", cfg.Console+"/api/demo/claims/select", "", map[string]string{"flowToken": flow, "accountId": cfg.AccountID}) |
| } |
| if code != 202 { |
| t.Fatal("dev reservation refused") |
diff --git a/internal/console/managedbudget_test.go b/internal/console/managedbudget_test.go| index 2552efb86..73aca57ba 100644 |
| --- a/internal/console/managedbudget_test.go |
| +++ b/internal/console/managedbudget_test.go |
| @@ -252,10 +252,10 @@ func TestManagedPublicationRefreshBudget(t *testing.T) { |
| } |
| }) |
| t.Run("crash-after-attempt", func(t *testing.T) { |
| - s, b, now := readyFixture(t) |
| + s, _, now := readyFixture(t) |
| st := countReadiness(s) |
| st.failPut = true |
| - b = workerStep(t, s, now) |
| + b := workerStep(t, s, now) |
| st.failPut = false |
| // The attempt stamp was written, then the process died before any |
| // observation: the old passing checks must not authorize a PUT. |
diff --git a/internal/console/managedenrol_test.go b/internal/console/managedenrol_test.go| index ec8576939..af094d4e6 100644 |
| --- a/internal/console/managedenrol_test.go |
| +++ b/internal/console/managedenrol_test.go |
| @@ -25,8 +25,8 @@ import ( |
| func enrolFixture(t *testing.T) (*Server, managedBox, string, time.Time) { |
| t.Helper() |
| - s, _, _, now := managedWorkerFixture(t) |
| - now = time.Now().UTC() |
| + s, _, _, _ := managedWorkerFixture(t) |
| + now := time.Now().UTC() |
| b := workerStep(t, s, now) |
| key, _, err := openManagedEnrolKey(s.cfg.AlertSealKeyPath) |
| if err != nil { |
diff --git a/internal/console/managedrecovery_test.go b/internal/console/managedrecovery_test.go| index 05a563c05..af11928ff 100644 |
| --- a/internal/console/managedrecovery_test.go |
| +++ b/internal/console/managedrecovery_test.go |
| @@ -363,7 +363,7 @@ func TestManagedDeadlineBeforeBackoff(t *testing.T) { |
| t.Run(state, func(t *testing.T) { |
| s, p, _, now := managedWorkerFixture(t) |
| b := workerStep(t, s, now) |
| - b = workerAdvance(t, s, b, func(b *managedBox) { |
| + workerAdvance(t, s, b, func(b *managedBox) { |
| b.State = state |
| b.ReadyAt = now.Add(time.Minute) |
| if state == "publishing" { |
diff --git a/internal/console/managedworker.go b/internal/console/managedworker.go| index 6f4059ac3..b0811d062 100644 |
| --- a/internal/console/managedworker.go |
| +++ b/internal/console/managedworker.go |
| @@ -160,7 +160,7 @@ func (s *Server) managedFleetsPass(ctx context.Context, now time.Time) error { |
| ctx = context.WithValue(ctx, managedReadinessPassKey{}, &managedReadinessPass{}) |
| ctx = s.managedPassClock(ctx, now) |
| unprepared := map[string]bool{} |
| - ops, boxes, err := s.store.ManagedWork(ctx) |
| + ops, _, err := s.store.ManagedWork(ctx) |
| if err != nil { |
| return errManagedWorker |
| } |
| @@ -215,7 +215,7 @@ func (s *Server) managedFleetsPass(ctx context.Context, now time.Time) error { |
| unlock() |
| } |
| } |
| - _, boxes, err = s.store.ManagedWork(ctx) |
| + _, boxes, err := s.store.ManagedWork(ctx) |
| if err != nil { |
| return errManagedWorker |
| } |
diff --git a/internal/console/managedworker_test.go b/internal/console/managedworker_test.go| index 5fbd93fe0..bc50e7555 100644 |
| --- a/internal/console/managedworker_test.go |
| +++ b/internal/console/managedworker_test.go |
| @@ -143,7 +143,7 @@ func TestManagedDeadline(t *testing.T) { |
| t.Run(state, func(t *testing.T) { |
| s, p, _, now := managedWorkerFixture(t) |
| b := workerStep(t, s, now) |
| - b = workerAdvance(t, s, b, func(b *managedBox) { b.State = state }) |
| + workerAdvance(t, s, b, func(b *managedBox) { b.State = state }) |
| workerStep(t, s, now.Add(20*time.Minute-time.Second)) |
| if got := workerBox(t, s); got.State == "failed" || got.State == "terminating" { |
| t.Fatal("early failure") |
| @@ -276,8 +276,8 @@ func TestManagedAcceptedTerminateAbsent(t *testing.T) { |
| for _, kind := range []string{"lost-response", "notfound", "crash-before-dispatch", "no-attempt", "different-id", "identity-empty", "stopped", "shutting-down"} { |
| t.Run(kind, func(t *testing.T) { |
| s, p, _, now := managedWorkerFixture(t) |
| - b := workerStep(t, s, now) |
| - b = workerStep(t, s, now.Add(20*time.Minute)) |
| + workerStep(t, s, now) |
| + b := workerStep(t, s, now.Add(20*time.Minute)) |
| spy := &managedComputeScript{Fake: p} |
| s.cfg.ManagedCompute = spy |
| switch kind { |
| @@ -843,9 +843,9 @@ func TestManagedFailedEnrolledBeforeTerminate(t *testing.T) { |
| } |
| func TestManagedWorkerClearsRetrySchedule(t *testing.T) { |
| - s, _, b, now := managedWorkerFixture(t) |
| - b = workerStep(t, s, now) |
| - b = workerAdvance(t, s, b, func(b *managedBox) { b.NextCleanupAt = now.Add(time.Second) }) |
| + s, _, _, now := managedWorkerFixture(t) |
| + b := workerStep(t, s, now) |
| + workerAdvance(t, s, b, func(b *managedBox) { b.NextCleanupAt = now.Add(time.Second) }) |
| b = workerStep(t, s, now.Add(time.Second)) |
| if !b.NextCleanupAt.IsZero() { |
| t.Fatal("successful observation retained an expired retry time") |
diff --git a/internal/console/overview_test.go b/internal/console/overview_test.go| index 42abeaab0..66094834a 100644 |
| --- a/internal/console/overview_test.go |
| +++ b/internal/console/overview_test.go |
| @@ -537,7 +537,7 @@ func TestInstancesPageFilters(t *testing.T) { |
| if status != http.StatusOK || !strings.Contains(body, "No addresses match.") { |
| t.Fatalf("filtered-empty state missing (%d):\n%s", status, body) |
| } |
| - status, _, body = get(t, c, fx.u("/apps/kass/instances?health=running")) |
| + status, _, _ = get(t, c, fx.u("/apps/kass/instances?health=running")) |
| if status != http.StatusOK { |
| t.Fatalf("health filter = %d", status) |
| } |
diff --git a/internal/domains/freshdns_test.go b/internal/domains/freshdns_test.go| index 8af6496f1..9f7047404 100644 |
| --- a/internal/domains/freshdns_test.go |
| +++ b/internal/domains/freshdns_test.go |
| @@ -1283,7 +1283,7 @@ func TestFreshResolverForgetEndsTheBackoff(t *testing.T) { |
| // cost) to the zone, as main did. A new name never climbs: the cache |
| // hears nothing below the registrable domain. |
| func TestFreshResolverUpgradeClimbsPastNonZoneLabels(t *testing.T) { |
| - w, last := deepWorld(t) |
| + w, _ := deepWorld(t) |
| ips, err := w.resolver(clock()).ResolveUpgrade(deepGapName) |
| if err != nil || len(ips) != 1 || ips[0] != edgeIP { |
| t.Fatalf("ResolveUpgrade = %v, %v; want [%s] from a.b.c.d.example.com", ips, err, edgeIP) |
| @@ -1292,7 +1292,7 @@ func TestFreshResolverUpgradeClimbsPastNonZoneLabels(t *testing.T) { |
| if got := strings.Join(w.cached, ","); got != want { |
| t.Fatalf("cached queries = %s, want %s", got, want) |
| } |
| - w, last = deepWorld(t) |
| + w, last := deepWorld(t) |
| if ips, err := w.resolver(clock()).Resolve(deepGapName); err == nil { |
| t.Fatalf("Resolve = %v, want the new name's walk refused at the referral bound", ips) |
| } |
diff --git a/internal/domains/reconcile.go b/internal/domains/reconcile.go| index d17181c09..6a6cd1f3a 100644 |
| --- a/internal/domains/reconcile.go |
| +++ b/internal/domains/reconcile.go |
| @@ -346,7 +346,7 @@ func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg |
| // --- 3. canary hosts: mint for hostless pointers, remove for retired ---- |
| canaryChannels := map[appKey]map[string]bool{} // (account, app) -> live canary/<name> channels |
| for _, key := range keys { |
| - acctOfKey, app, _, ok := appKeyOwner(key, known) |
| + acctOfKey, _, _, ok := appKeyOwner(key, known) |
| if !ok { |
| continue |
| } |
diff --git a/internal/host/claimmoveaccess_test.go b/internal/host/claimmoveaccess_test.go| index 7c6b72d40..a38269c22 100644 |
| --- a/internal/host/claimmoveaccess_test.go |
| +++ b/internal/host/claimmoveaccess_test.go |
| @@ -32,7 +32,7 @@ func TestPlan10G2ReadAccess(t *testing.T) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - o, err = hostclaim.Update(ctx, f.claims, o, func(c *hostclaim.Claim) error { |
| + _, err = hostclaim.Update(ctx, f.claims, o, func(c *hostclaim.Claim) error { |
| c.Op = hostclaim.Op{Kind: hostclaim.KindLanding, ID: "m1", Phase: hostclaim.PhaseProbing, Exec: "box-1", Participants: []string{"box-0", "box-1"}, Intent: map[string]string{"source": "box-0", "target": "box-1", "to": "ie"}} |
| return nil |
| }) |
diff --git a/internal/host/claimservingpark_linux_test.go b/internal/host/claimservingpark_linux_test.go| index ad3d2d3fb..a1f0d5fcb 100644 |
| --- a/internal/host/claimservingpark_linux_test.go |
| +++ b/internal/host/claimservingpark_linux_test.go |
| @@ -603,7 +603,8 @@ func TestServingParkLedgerDurableWriteFailures(t *testing.T) { |
| } |
| if err == nil { |
| f.now = r.ReapAfter |
| - err = f.ledger.withNamespace(t.Context(), func() error { return f.ledger.reapLocked(t.Context(), a.ID) }) |
| + // The reap is the last write; whether its fault landed or not, the replay below must finish it. |
| + _ = f.ledger.withNamespace(t.Context(), func() error { return f.ledger.reapLocked(t.Context(), a.ID) }) |
| } |
| f.ledger.state, f.fs.state = f.disk, f.disk |
| if _, readErr := f.disk.Read("namespace.json"); os.IsNotExist(readErr) { |
diff --git a/internal/host/claimstop_writers_rev4_linux_test.go b/internal/host/claimstop_writers_rev4_linux_test.go| index 756b61849..506c04da5 100644 |
| --- a/internal/host/claimstop_writers_rev4_linux_test.go |
| +++ b/internal/host/claimstop_writers_rev4_linux_test.go |
| @@ -38,7 +38,6 @@ func TestRev4WritersPrefixCoverage(t *testing.T) { |
| if err := os.Remove(target); err != nil { |
| t.Fatal(err) |
| } |
| - target += " (deleted)" |
| } |
| if shape == "empty-directory" { |
| if err := os.Remove(fx.db); err != nil { |
diff --git a/internal/host/link_sim_test.go b/internal/host/link_sim_test.go| index 99ba672de..39819def4 100644 |
| --- a/internal/host/link_sim_test.go |
| +++ b/internal/host/link_sim_test.go |
| @@ -518,7 +518,7 @@ func (s *homeSim) openWS(name string) { |
| } |
| buf := make([]byte, 4) |
| if _, err := conn.Write([]byte("ping")); err == nil { |
| - _, err = io.ReadFull(br, buf) |
| + io.ReadFull(br, buf) // a short read fails the echo check below |
| } |
| conn.SetDeadline(time.Time{}) |
| got := s.reached(id, "a WebSocket open") |
diff --git a/internal/host/movesbuildstatepark_test.go b/internal/host/movesbuildstatepark_test.go| index d69594361..c92789520 100644 |
| --- a/internal/host/movesbuildstatepark_test.go |
| +++ b/internal/host/movesbuildstatepark_test.go |
| @@ -27,6 +27,7 @@ func TestALandingOntoALocationHoldingABuildStateCompletes(t *testing.T) { |
| h := newLandingHarness(t) |
| storeState(h.phase1Harness, "data-ie", cutRoot+"/build-state.json", "v6") |
| h.flip(t) |
| + //lint:ignore SA4006 the residue is planted here, before the landing; keys is read after the parked flow's skip comes off |
| keys := h.residue(t) |
| dst := cutRoot + "/build-state.json" |
| if _, err := h.vs.PutIfAbsent(context.Background(), "data-uk", dst, []byte(p1StateBody("v3"))); err != nil { |
diff --git a/internal/host/movesfileslive_test.go b/internal/host/movesfileslive_test.go| index fc98f002f..db317c31a 100644 |
| --- a/internal/host/movesfileslive_test.go |
| +++ b/internal/host/movesfileslive_test.go |
| @@ -494,8 +494,8 @@ func admitTarget(t *testing.T, h *landingHarness) { |
| // parked/. |
| func TestSourceCleanupKeepsTheFilesLiveSetUntilTheCommit(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h := newFinalHarness(t) |
| h.advanceToProbed(t) |
| admitTarget(t, h.landingHarness) |
| @@ -554,8 +554,8 @@ func TestSourceCleanupKeepsTheFilesLiveSetUntilTheCommit(t *testing.T) { |
| // back, the target's cleaning runs it and the files are retired. |
| func TestRollbackReturnCleanupKeepsTheFilesLiveSet(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "its flow carries <host>.env and stops at one of the parked refusals") |
| + ctx := context.Background() |
| h := newRollbackHarness(t) |
| admitTarget(t, h.landingHarness) |
| location := strings.TrimSuffix(h.claim(t).Holder.Location, "/") |
diff --git a/internal/host/movesinstall_test.go b/internal/host/movesinstall_test.go| index 5053d31d4..fb832f43a 100644 |
| --- a/internal/host/movesinstall_test.go |
| +++ b/internal/host/movesinstall_test.go |
| @@ -480,6 +480,7 @@ func TestDirtyReturnInstallsUnderTheSourceStamp(t *testing.T) { |
| func TestDirtyReturnParksAnUnregisteredSource(t *testing.T) { |
| t.Parallel() |
| h := newReturnHarness(t, false) |
| + //lint:ignore SA4006 the inputs are pinned before the install; pinned is read after the parked flow's skip comes off |
| pinned := h.read(t, p1Host).Move.Inputs |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| if refused, err := h.install(t); err != nil || refused != "" { |
diff --git a/internal/host/movesland_test.go b/internal/host/movesland_test.go| index 70de4c216..df0df1600 100644 |
| --- a/internal/host/movesland_test.go |
| +++ b/internal/host/movesland_test.go |
| @@ -617,7 +617,6 @@ func (h *landingHarness) installed(t *testing.T) moves.InstallManifest { |
| // <dbPath>.gen written, installed_db_sha256 recorded, the lease released. |
| func TestLandingBuildsInstallsAndRestores(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| h := newLandingHarness(t) |
| h.timers = []registry.Timer{{Host: p1Host, Name: "nightly", Kind: "cron", Spec: "0 3 * * *", NextAt: 1000, Attempts: 2, Registration: "reg-1"}, |
| {Host: p1Host, Name: "once", Kind: "once", NextAt: 2000, DueAt: 2000, Registration: "reg-2"}} |
| @@ -625,6 +624,7 @@ func TestLandingBuildsInstallsAndRestores(t *testing.T) { |
| h.route.Replication = "" |
| h.land(t) |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| im := h.installed(t) |
| // The generation holds exactly the build's four objects, at usable |
| // versions, in this box's own bucket. |
| @@ -843,7 +843,6 @@ func (h *landingHarness) residue(t *testing.T) []string { |
| // live here, Engine.Run on them acknowledges rather than refusing. |
| func TestLandingParkingWaitsForTheManifest(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| h := newLandingHarness(t) |
| h.flip(t) |
| keys := h.residue(t) |
| @@ -899,6 +898,7 @@ func TestLandingParkingWaitsForTheManifest(t *testing.T) { |
| h.vs.skipDelete = nil |
| h.land(t) |
| skipParkedSecretFlow(t, "its flow carries <host>.env and stops at one of the parked refusals") |
| + ctx := context.Background() |
| h.installed(t) |
| c = h.claim(t) |
| var retirements []string |
| @@ -1002,7 +1002,6 @@ func TestLandingParkingWaitsForTheManifest(t *testing.T) { |
| // walked step by step, with each transition written separately. |
| func TestLandingPhaseCatchUp(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| h := newLandingHarness(t) |
| h.flip(t) |
| h.landAt = "after-record-parking" |
| @@ -1018,6 +1017,7 @@ func TestLandingPhaseCatchUp(t *testing.T) { |
| h.landDone = false |
| h.land(t) |
| skipParkedSecretFlow(t, "its flow carries <host>.env and stops at one of the parked refusals") |
| + ctx := context.Background() |
| h.installed(t) |
| // A claim left at checking with the record at restored. |
| @@ -1194,8 +1194,8 @@ func TestLandingConfiguredPinsInputs(t *testing.T) { |
| return appconfig.HeldRender{BundleETags: map[string]string{"default": "e2", "environment": ""}}, nil |
| } |
| h.land(t) |
| - m := h.read(t, p1Host).Move |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + m := h.read(t, p1Host).Move |
| if m.Reason != provision.RollbackConfigChanged || m.LandingPhase != provision.LandConfigured || m.State != provision.MoveLanding { |
| t.Fatalf("after the render: %+v", m) |
| } |
| @@ -1961,11 +1961,11 @@ func TestLandingCorruptBuildMarksRollback(t *testing.T) { |
| // at the next generation write, and the replay completes. |
| func TestLandingRebuildNeedsTheLease(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| h := newLandingHarness(t) |
| h.flip(t) |
| h.landAt = "after-record-configured" |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h.crashLand(t) |
| if err := os.RemoveAll(filepath.Join(h.tdir, ".moves", p1Host, p1ID, "build")); err != nil { |
| t.Fatal(err) |
diff --git a/internal/host/movesloss_test.go b/internal/host/movesloss_test.go| index c3c5a0fea..5c3595afd 100644 |
| --- a/internal/host/movesloss_test.go |
| +++ b/internal/host/movesloss_test.go |
| @@ -628,8 +628,8 @@ func (failingList) ListVersions(context.Context, string, string) ([]lease.Object |
| // or that is not the source baseline, waits (hostbox.ErrChanged), which the |
| // probe adapter turns into another pass. |
| func TestLossSourcesReadOnlyTheRestorePlan(t *testing.T) { |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| f := newRCFixture(t, rcClean) |
| pub := f.declare(false, []hostclaim.WriteSource{rcCutSource()}, rcBeforeTarget) |
| o := f.read() |
| @@ -663,8 +663,8 @@ func TestLossSourcesReadOnlyTheRestorePlan(t *testing.T) { |
| // lineage link and the source baseline before the CAS, as every recovery |
| // admission does. |
| func TestRecoveryAdmissionEvidenceAcceptsTheFrozenMaximum(t *testing.T) { |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| f := newRCFixture(t, rcClean) |
| pub := f.declare(false, []hostclaim.WriteSource{rcCutSource()}, rcBeforeTarget) |
| o := f.read() |
| @@ -838,8 +838,8 @@ func TestLostTargetReturnDeclaresEverySessionOnce(t *testing.T) { |
| // mv's generation) is declared lost. The validated source carries the same |
| // 0, which the claim compares (lost.go:194). |
| func TestLostTargetGenerationOutsideTheRestoreDeclaresAllItsWrites(t *testing.T) { |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| f := newRCFixture(t, rcClean) |
| // The target's own bucket, which the source never reads: t2 restarted |
| // at [1, 1] and holds TXID 2. |
diff --git a/internal/host/movesrecover_test.go b/internal/host/movesrecover_test.go| index aa1a72e60..fa54894cf 100644 |
| --- a/internal/host/movesrecover_test.go |
| +++ b/internal/host/movesrecover_test.go |
| @@ -661,8 +661,8 @@ func TestSourceRecoveryNeverReverifiesAfterProbing(t *testing.T) { |
| // (TestBoxClosesAreRecordFirst). |
| func TestRolledBackFinalizationReleasesTheClaim(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h := newRecoverHarness(t, false) |
| h.released(t) |
| h.srcPass(t) |
diff --git a/internal/host/movesrecoveryowners_test.go b/internal/host/movesrecoveryowners_test.go| index 7ae245322..adcf021f8 100644 |
| --- a/internal/host/movesrecoveryowners_test.go |
| +++ b/internal/host/movesrecoveryowners_test.go |
| @@ -688,13 +688,13 @@ func TestRevertProbeAdmitsUncovered(t *testing.T) { |
| // the recovery owners, and the moving kind nothing; without C8 the |
| // recovery kinds refuse, typed, while the landing is unchanged. |
| func TestMovesOwnersDispatchByKind(t *testing.T) { |
| + skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| ctx := t.Context() |
| dispatch := func(m *movesProbeOwners) ClaimOwnerDispatch { |
| owners := m.MovesOwners(&movesProbeAttempts{}).ClaimKindOwners |
| return ClaimOwnerDispatch{Moves: &owners} |
| } |
| - skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| landing := newPOFixture(t) |
| landing.owners.Files = &rcFiles{f: landing} |
| in, err := dispatch(landing.owners).Select(ctx, landing.route, landing.read(), poProbe) |
diff --git a/internal/host/movesrollback_test.go b/internal/host/movesrollback_test.go| index 273f93de2..b3bf454ec 100644 |
| --- a/internal/host/movesrollback_test.go |
| +++ b/internal/host/movesrollback_test.go |
| @@ -327,8 +327,8 @@ func TestRollbackDecisionConvertsTheMark(t *testing.T) { |
| // they were. The open is the commit's path (Plan 3 Task 7). |
| func TestRollbackCASLosesToCommit(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h := newRollbackHarness(t) |
| h.step(t, provision.LandProbing, provision.LandProbed) |
| stale := h.read(t, p1Host) |
| @@ -375,8 +375,8 @@ func TestRollbackCASLosesToCommit(t *testing.T) { |
| // park-local, and the target region's predecessors are covered. |
| func TestReleaseIsCleanWhenNothingChanged(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h := newRollbackHarness(t) |
| rewriteP1Claim(t, h.s, func(c *hostclaim.Claim) { |
| c.Holder.Admissions = append(c.Holder.Admissions, hostclaim.AdmissionRecord{Region: "uk", PredecessorRegion: "uk", Session: 3, |
| @@ -473,8 +473,8 @@ func TestReleaseBeforeProbingNeedsNoDigests(t *testing.T) { |
| // return lane gets the staged seal's exact versions, as given. |
| func TestReleaseIsDirtyWithoutSrcCovered(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h := newRollbackHarness(t) |
| h.uncover(t) |
| staged := h.seal(t) |
| @@ -585,8 +585,8 @@ func decodeLTXDatabase(t *testing.T, body []byte, path string) ltx.Header { |
| // the return seal names exactly it. |
| func TestDirtyReturnSnapshotsTheStoppedDatabase(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h := newRollbackHarness(t) |
| dbPath := provision.DefaultDBPath(h.tdir, p1Host) |
| d, err := sql.Open("sqlite", dbPath) |
| @@ -679,8 +679,8 @@ func TestDirtyReturnSnapshotsTheStoppedDatabase(t *testing.T) { |
| // LeaseUntil + H, not before. |
| func TestReturnLaneWriterIsGuarded(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h := newRollbackHarness(t) |
| h.uncover(t) |
| h.rollBack(t) |
diff --git a/internal/host/movesrollback_witness_test.go b/internal/host/movesrollback_witness_test.go| index 10010fdca..31c2a5364 100644 |
| --- a/internal/host/movesrollback_witness_test.go |
| +++ b/internal/host/movesrollback_witness_test.go |
| @@ -43,8 +43,8 @@ func sourceGenerationObjects(h *recoverHarness) map[string]fakeMoveObject { |
| // Commit covers the record (hostclaim's half of the witness). |
| func TestRollbackBaselineSurvivesTheCleanReturn(t *testing.T) { |
| t.Parallel() |
| - ctx := context.Background() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := context.Background() |
| h := newRecoverHarness(t, false) |
| baseline := sourceGenerationObjects(h) |
| if len(baseline) == 0 { |
diff --git a/internal/host/moveswakesource_linux_test.go b/internal/host/moveswakesource_linux_test.go| index 89634a622..70d54fb35 100644 |
| --- a/internal/host/moveswakesource_linux_test.go |
| +++ b/internal/host/moveswakesource_linux_test.go |
| @@ -760,8 +760,8 @@ func mwDeclare(t *testing.T, f *rcFixture) (ed25519.PublicKey, string, string) { |
| // restore does not contain the move id's generation) and the uncovered cut |
| // at the seal's maximum; the source restores its own baseline. |
| func TestLostTargetRecoveryRunsAgainstARealDeclaration(t *testing.T) { |
| - ctx := t.Context() |
| skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)") |
| + ctx := t.Context() |
| f := newRCFixture(t, rcClean) |
| pub, lossID, rb := mwDeclare(t, f) |
| o := f.read() |
diff --git a/internal/host/plan14_fix5_live_linux_test.go b/internal/host/plan14_fix5_live_linux_test.go| index b55be925a..ce05e0bdb 100644 |
| --- a/internal/host/plan14_fix5_live_linux_test.go |
| +++ b/internal/host/plan14_fix5_live_linux_test.go |
| @@ -167,7 +167,7 @@ func fix5Run(t *testing.T, kind, history string, main bool) []fix5Result { |
| pr := f.e.root |
| pr.obs = observer |
| restart := rootRestartRouteWith(f.e.root.reg, u, f.u.opt, getenv, observer.recordSettled(f.e.bake), f.c) |
| - rollback := rollbackUnitRestart(f.e.root.reg, u, f.u.opt, getenv, f.c) |
| + var rollback func(string) error |
| startChecks := f.c |
| startChecks.legacyStart = u.Start |
| start := rollbackUnitRestart(f.e.root.reg, u, f.u.opt, getenv, startChecks) |
diff --git a/internal/host/plan14_root_failures_root_linux_test.go b/internal/host/plan14_root_failures_root_linux_test.go| index dcc9844aa..b5de4627d 100644 |
| --- a/internal/host/plan14_root_failures_root_linux_test.go |
| +++ b/internal/host/plan14_root_failures_root_linux_test.go |
| @@ -88,7 +88,7 @@ func TestPlan14SwapFailureHostileRootRunner(t *testing.T) { |
| } |
| return op() |
| }) |
| - b, err = rollout.OpenRootFailures(fault, "box/en/1") |
| + _, err = rollout.OpenRootFailures(fault, "box/en/1") |
| if err == nil { |
| t.Fatal("owed directory sync admitted") |
| } |
diff --git a/internal/host/replicaplacement.go b/internal/host/replicaplacement.go| index ea901d089..ad40559be 100644 |
| --- a/internal/host/replicaplacement.go |
| +++ b/internal/host/replicaplacement.go |
| @@ -123,7 +123,9 @@ func (w *replicaPlacementWorker) run(ctx context.Context, now time.Time) { |
| } else if err == nil && a.Contains(w.box) && rt != nil && rt.ReplicaIncarnation == inc && rt.ReplicaRevision == a.Revision && provision.ReplicaCoordinatorBox(&rec, now) == w.box && w.coordinator != nil { |
| if _, err = w.coordinator.Acquire(rctx, id); err == nil && w.publisher != nil { |
| // Acquire's new term reaches the publisher through the next record pass. |
| - done, err = w.publisher.publishCurrent(rctx, rec, *rt) |
| + // publishCurrent answers false with every error, so done alone |
| + // decides the retry. Like Acquire's, the error is not logged. |
| + done, _ = w.publisher.publishCurrent(rctx, rec, *rt) |
| } |
| } |
| cancel() |
diff --git a/internal/host/runs_test.go b/internal/host/runs_test.go| index aa8cce854..65f4592c7 100644 |
| --- a/internal/host/runs_test.go |
| +++ b/internal/host/runs_test.go |
| @@ -179,11 +179,11 @@ func TestRunsWorkerForwardsACancelToItsRun(t *testing.T) { |
| w := testWorker(s, runOwnedRoute(runHost), "box-1", "boot-1", &l) |
| h := newRunHandle() |
| w.active[id] = h |
| - got, err := provision.SetRecordRun(context.Background(), s, "bab", "shop", runHost, provision.RunPick(id, "box-1", "boot-1", time.Now().Add(time.Hour))) |
| - if err != nil { |
| + if _, err := provision.SetRecordRun(context.Background(), s, "bab", "shop", runHost, provision.RunPick(id, "box-1", "boot-1", time.Now().Add(time.Hour))); err != nil { |
| t.Fatal(err) |
| } |
| - if got, err = provision.SetRecordRun(context.Background(), s, "bab", "shop", runHost, provision.RunCancelTransition(id)); err != nil { |
| + got, err := provision.SetRecordRun(context.Background(), s, "bab", "shop", runHost, provision.RunCancelTransition(id)) |
| + if err != nil { |
| t.Fatal(err) |
| } |
| w.consider(context.Background(), *got) |
diff --git a/internal/hostops/mail_reconcile.go b/internal/hostops/mail_reconcile.go| index 350f04372..0b81361ac 100644 |
| --- a/internal/hostops/mail_reconcile.go |
| +++ b/internal/hostops/mail_reconcile.go |
| @@ -147,7 +147,9 @@ func (w *ControlWriter) ReconcileMailGate(ctx context.Context, gateID string, mi |
| if err != nil { |
| return MailGateReconciliation{}, err |
| } |
| - if tag, err = w.raw.Put(ctx, MailGateKey, body, tag); err != nil { |
| + // The fenced revision is what step 4 checks: it re-reads the gate |
| + // and its tag, so this write's tag is not kept. |
| + if _, err = w.raw.Put(ctx, MailGateKey, body, tag); err != nil { |
| return MailGateReconciliation{}, err |
| } |
| } |
diff --git a/internal/hostrelocate/participant.go b/internal/hostrelocate/participant.go| index 09fd47149..d6e11d403 100644 |
| --- a/internal/hostrelocate/participant.go |
| +++ b/internal/hostrelocate/participant.go |
| @@ -268,7 +268,7 @@ func (p Participant) Step(ctx context.Context, host string) (hostclaim.Observed, |
| if err != nil { |
| return obs, err |
| } |
| - obs, c = counted, counted.Claim |
| + obs = counted |
| session, passed, err := p.Effects.Probe(ctx, obs, certified) |
| if err != nil || !passed { |
| return obs, errors.Join(ErrNotYet, err) |
diff --git a/internal/instancectl/gen.go b/internal/instancectl/gen.go| index 29e683ffa..f77fb0ccd 100644 |
| --- a/internal/instancectl/gen.go |
| +++ b/internal/instancectl/gen.go |
| @@ -422,13 +422,14 @@ func (s *Server) startGen(w http.ResponseWriter, r *http.Request, req request) { |
| // straight away, so the next reference reads the drop-in fresh: the |
| // common case needs no reload, which on a small box was a third of the |
| // whole wake. The check is the same either way (genDropInApplied). |
| - slice, applied, tierSet := s.genView(ctx, req.host, unit, req.tier) |
| + _, applied, tierSet := s.genView(ctx, req.host, unit, req.tier) |
| if !applied { |
| reloadStart := time.Now() |
| if out, err := s.Systemctl(ctx, "daemon-reload"); err != nil { |
| fail(http.StatusBadGateway, "daemon-reload: "+strings.TrimSpace(out+" "+err.Error())) |
| return |
| } |
| + var slice string |
| if slice, applied, tierSet = s.genView(ctx, req.host, unit, req.tier); !applied { |
| fail(http.StatusBadGateway, "not starting "+unit+": its drop-in did not apply (slice "+strconv.Quote(slice)+")") |
| return |
diff --git a/internal/instancectl/rootfs.go b/internal/instancectl/rootfs.go| index 68a08e8ee..82ff66ce5 100644 |
| --- a/internal/instancectl/rootfs.go |
| +++ b/internal/instancectl/rootfs.go |
| @@ -745,7 +745,7 @@ func (s *Server) startRootfs(w http.ResponseWriter, r *http.Request, req request |
| var slice string |
| applied, tierSet := true, false |
| if perStart { |
| - slice, applied, tierSet = s.rootfsView(ctx, req.host, unit, image, req.tier, withTier) |
| + _, applied, tierSet = s.rootfsView(ctx, req.host, unit, image, req.tier, withTier) |
| } |
| reload := "skipped" |
| if !applied || changed || s.jitReloadOwed() { |
diff --git a/internal/mail/walk_environment_test.go b/internal/mail/walk_environment_test.go| index 105c23ca8..5168cfa0b 100644 |
| --- a/internal/mail/walk_environment_test.go |
| +++ b/internal/mail/walk_environment_test.go |
| @@ -43,7 +43,7 @@ func TestEnvironmentUserNameAndCallerParsing(t *testing.T) { |
| func TestEnableEnvironmentMintsADistinctCredentialIntoTheOwnedBundle(t *testing.T) { |
| ctx, s, p, pub, now := enableFixture(t) |
| - rec, err := Enable(ctx, s, p, mailTestSealer(pub, "bag", "harbourmail"), testDeployment(), "bag", "harbourmail", now) |
| + _, err := Enable(ctx, s, p, mailTestSealer(pub, "bag", "harbourmail"), testDeployment(), "bag", "harbourmail", now) |
| if err != nil { |
| t.Fatal(err) |
| } |
| @@ -61,7 +61,7 @@ func TestEnableEnvironmentMintsADistinctCredentialIntoTheOwnedBundle(t *testing. |
| t.Fatal(err) |
| } |
| before, _ := appconfig.Get(ctx, s, "bag", "harbourmail") |
| - rec, err = EnableEnvironment(ctx, s, p, mailTestSealer(pub, "bag", "harbourmail"), testDeployment(), "bag", "harbourmail", "team", now) |
| + rec, err := EnableEnvironment(ctx, s, p, mailTestSealer(pub, "bag", "harbourmail"), testDeployment(), "bag", "harbourmail", "team", now) |
| if err != nil { |
| t.Fatalf("EnableEnvironment: %v", err) |
| } |
diff --git a/internal/maintenanceguard/guard_test.go b/internal/maintenanceguard/guard_test.go| index 92a8712ce..d638f2ff6 100644 |
| --- a/internal/maintenanceguard/guard_test.go |
| +++ b/internal/maintenanceguard/guard_test.go |
| @@ -132,7 +132,7 @@ func TestGuardResumeCrashProjectionAndContracts(t *testing.T) { |
| denied(t, f, &p, []string{"home.operator.v1"}) |
| } |
| oldProjection, _ := s.Projection() |
| - s = f.step(t, c, s, guard.Resumed) |
| + f.step(t, c, s, guard.Resumed) |
| // Durable guard publication without the record CAS must not open admission. |
| denied(t, f, &oldProjection, []string{"home.operator.v1"}) |
| denied(t, f, nil, []string{"home.operator.v1"}) |
| @@ -177,7 +177,7 @@ func TestGuardStaleWorkersAndExecutingRecovery(t *testing.T) { |
| t.Fatal("stale write did not preserve CAS conflict", e) |
| } |
| s := f.step(t, c, second, guard.Fenced) |
| - s = f.step(t, c, s, guard.Executing) |
| + f.step(t, c, s, guard.Executing) |
| afterCrash, e := f.repo.ReadGuard(ctx, f.identity.Host) |
| if e != nil { |
| t.Fatal(e) |
diff --git a/internal/objstore/queue_test.go b/internal/objstore/queue_test.go| index 4d0dc8a11..0e5c534b9 100644 |
| --- a/internal/objstore/queue_test.go |
| +++ b/internal/objstore/queue_test.go |
| @@ -1245,13 +1245,12 @@ func TestReusedVerdictCarriesNoProvenance(t *testing.T) { |
| s, sc, idx, bucket := queueFixture(t, 1) |
| // Pre-tag the object at its current version, as a sweep would have. |
| - obj := ScanObject{Key: objectName(0), ETag: "etag-" + objectName(0), Size: 10} |
| status, seen, err := sc.Status(ctx, bucket, objectName(0)) |
| if err != nil { |
| t.Fatal(err) |
| } |
| _ = status |
| - obj = seen |
| + obj := seen |
| sc.Put(bucket, objectName(0), obj.Version(), VerdictClean) |
| enqueueN(t, s, idx, 1) |
diff --git a/internal/provision/census_propose_internal_test.go b/internal/provision/census_propose_internal_test.go| index cdd3a2519..63f1002e2 100644 |
| --- a/internal/provision/census_propose_internal_test.go |
| +++ b/internal/provision/census_propose_internal_test.go |
| @@ -343,12 +343,12 @@ func TestCensusNamesWholeKeys(t *testing.T) { |
| // A body change to a unit whose key has a space is still an approval. |
| func TestCensusClassifiesAKeyWithASpace(t *testing.T) { |
| - got, inv, seal := proposeFixture(t) |
| + got, inv, _ := proposeFixture(t) |
| key := "internal/a/t.go:type gen" |
| e := classifiedRootRead{rootReadEntry: rootReadEntry{File: "internal/a/t.go", Unit: "type gen", Kinds: "registry:Host@3", Digest: strings.Repeat("7", 64)}, Class: "legacy", Task: "accepted-legacy", Basis: "accepted-legacy;rev3=J1;basis=root-route"} |
| inv.Entries[key], inv.Frozen[key] = e, e |
| inv.Legacy[rootReadLegacyFingerprint(e)] = true |
| - seal = rootReadLegacySeal(inv) |
| + seal := rootReadLegacySeal(inv) |
| got.Entries = append(got.Entries, e.rootReadEntry) |
| got.Declarations[key] = e.Digest |
| change(&got, key, "registry:Host@4", strings.Repeat("8", 64)) |
diff --git a/internal/provision/replicaassignment_test.go b/internal/provision/replicaassignment_test.go| index 7613d4f39..9ff49f08a 100644 |
| --- a/internal/provision/replicaassignment_test.go |
| +++ b/internal/provision/replicaassignment_test.go |
| @@ -345,7 +345,7 @@ func TestReplicaAssignmentManifestEvidence(t *testing.T) { |
| if _, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}}); err == nil || !bytes.Equal(before, assignmentBytes(t, s, id)) { |
| t.Fatal("bootstrap lost the old copy") |
| } |
| - got, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}, Retiring: []string{"old"}}) |
| + _, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}, Retiring: []string{"old"}}) |
| if err != nil { |
| t.Fatal(err) |
| } |
| @@ -360,7 +360,7 @@ func TestReplicaAssignmentManifestEvidence(t *testing.T) { |
| ctx, s, _, id, want = assignmentFixture(t) |
| assignmentReplace(t, s, id, func(r *Record) { r.RecordSeq = 0 }) |
| want.RecordSeq = 0 |
| - got, err = SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 1, Boxes: []string{"a"}}) |
| + got, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 1, Boxes: []string{"a"}}) |
| if err != nil || got.RecordSeq != 1 { |
| t.Fatalf("legacy counter: %+v %v", got, err) |
| } |
| @@ -419,10 +419,10 @@ func (s *assignmentCountingStore) Put(ctx context.Context, key string, body []by |
| func TestReplicaAssignmentLegacyWriterReadBudget(t *testing.T) { |
| for _, region := range []bool{false, true} { |
| - ctx, base, rec, id, _ := assignmentFixture(t) |
| + _, base, rec, id, _ := assignmentFixture(t) |
| // A legacy stateful record has no manifest evidence or assignment. |
| assignmentReplace(t, base, id, func(r *Record) { r.Hibernate = nil }) |
| - ctx = context.Background() |
| + ctx := context.Background() |
| s := &assignmentCountingStore{Store: base} |
| var err error |
| if region { |
| @@ -488,12 +488,12 @@ func TestReplicaAssignmentUnknownMembersSurviveOrdinaryWrite(t *testing.T) { |
| func TestReplicaCoordinatorTransferAfterExpiry(t *testing.T) { |
| ctx, s, _, id, want := assignmentFixture(t) |
| - rec, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}}) |
| + _, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}}) |
| if err != nil { |
| t.Fatal(err) |
| } |
| now := time.Now() |
| - rec, err = SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "a", BootID: "boot"}, now) |
| + rec, err := SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "a", BootID: "boot"}, now) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/provision/replicadeploy_test.go b/internal/provision/replicadeploy_test.go| index eac581c44..35ccd4f8d 100644 |
| --- a/internal/provision/replicadeploy_test.go |
| +++ b/internal/provision/replicadeploy_test.go |
| @@ -236,7 +236,7 @@ func TestReplicaReleaseLegalTransitions(t *testing.T) { |
| t.Fatalf("begin replay: %+v %v", replay, err) |
| } |
| d.Phase = "releasing" |
| - r, err = SetRecordReplicaRelease(ctx, s, id, 1, d) |
| + _, err = SetRecordReplicaRelease(ctx, s, id, 1, d) |
| if err != nil { |
| t.Fatal(err) |
| } |
| @@ -386,11 +386,11 @@ var swapTarget = replicas.Build{Version: "v2", Digest: "canonical-2"} |
| func newSwapWorld(t *testing.T, phases ...string) *swapWorld { |
| t.Helper() |
| ctx, s, _, id, want := assignmentFixture(t) |
| - rec, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}}) |
| + _, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}}) |
| if err != nil { |
| t.Fatal(err) |
| } |
| - rec, err = SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "a", BootID: "boot"}, time.Now()) |
| + rec, err := SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "a", BootID: "boot"}, time.Now()) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/registry/links_writers_test.go b/internal/registry/links_writers_test.go| index 5a347510b..dc1b6b03c 100644 |
| --- a/internal/registry/links_writers_test.go |
| +++ b/internal/registry/links_writers_test.go |
| @@ -147,7 +147,7 @@ func TestPutLinkChannelPrunesOnlyItsLink(t *testing.T) { |
| // L1 moves to acct2: its acct1 rows go; L2's acct1 row, L3's acct2 row, |
| // the acct1 fleet row and both ordinary rows stay. |
| putLink(t, reg, activeLink(testLinkA, "acct2", 3)) |
| - snap = assertOnlyChanged(t, "account change", snap, reg, hostL1Shop, hostL1Blog) |
| + assertOnlyChanged(t, "account change", snap, reg, hostL1Shop, hostL1Blog) |
| assertGone(t, reg, hostL1Shop, hostL1Blog) |
| // An acct2 row on L1, then a write that revokes L1: only that row goes. |