Review round 3: gofmt on the builder's reserve test; the held-build integration step answers a kept revision as itself and waits for the rerun step-started

Builds: design 47 H2 H-A-619, H-A-583 (2)
This commit is contained in:
2026-11-25 20:19:55 +01:00
parent 08515e2706
commit ca220cb0da
2 changed files with 16 additions and 5 deletions
@@ -495,7 +495,7 @@ func TestABuiltReservationIsTakenInFromItsState(t *testing.T) {
if !slices.Equal(said, []string{"look:a@" + v.Version + " sha256:looka"}) || !slices.Equal(asked, []string{"look " + v.Version}) {
t.Errorf("at a look: said %v, publish items asked %v; want look:a's package-published said and its item asked", said, asked)
}
if ends := boundEnds("look"); !ends.Equal(v.BuiltAt.Add(defaultPublishAckMinutes*time.Minute)) {
if ends := boundEnds("look"); !ends.Equal(v.BuiltAt.Add(defaultPublishAckMinutes * time.Minute)) {
t.Errorf("the bound armed at a look ends %v, want %v: counted from the build's end", ends, v.BuiltAt.Add(defaultPublishAckMinutes*time.Minute))
}
if cur, _, _ := rv.r.Of(ctx, "look", v.Version); len(cur.Kept) != 0 || !cur.Published["look:a"] {
@@ -35,7 +35,8 @@ func testASupersededBuildIsPassedOverOrHeldAndItsWaitEnds(t *testing.T) {
w := startWhole(t, ctx, []catalog.Registration{reg}, func(raw []byte) catalog.RevisionAnswer {
var in catalog.RevisionInput
_ = json.Unmarshal(raw, &in)
if nine.Load() && (in.Revision == 9 || in.Revision == 0) {
// A revision the catalog keeps answers as itself: a read naming 9 is answered 9 from the start; only the newest follows nine.
if in.Revision == 9 || (nine.Load() && in.Revision == 0) {
return catalog.RevisionAnswer{Revision: &catalog.CatalogRevision{Revision: 9, Kind: "trunk", Branch: "main", Source: 9},
Entries: []catalog.CatalogEntry{{Module: "app", Commit: "c1", Fp: "src2:a9"}}}
}
@@ -93,9 +94,19 @@ func testASupersededBuildIsPassedOverOrHeldAndItsWaitEnds(t *testing.T) {
return readPipeline(ctx, w.pipelines, key, &p) && stepOf(p, seat.StepResultStepBuild).Ask != first
})
again := stepOf(p, seat.StepResultStepBuild)
mu.Lock()
last := started[len(started)-1]
mu.Unlock()
// The runner says the step-started after the write: wait for the one with rerun.
var last seat.StepEvent
waitFor(t, ctx, w.logs, func() bool {
mu.Lock()
defer mu.Unlock()
for _, ev := range started {
if ev.Result.Rerun && ev.Result.Ask == again.Ask {
last = ev
return true
}
}
return false
})
if again.Outcome != seat.StepResultOutcomeRunning || !again.Rerun || len(p.Superseded) != 0 || !last.Result.Rerun || last.Result.By != "mesh-delivery-pipeline" || last.Result.Ask != again.Ask {
t.Fatalf("a superseded end naming an older revision left %+v, superseded %v, last step-started %+v; want the build asked again as a rerun by the runner, the mover staying", again, p.Superseded, last)
}