From 5ee08cb5e1215597c207602520261522fa18adb6 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 24 Oct 2026 04:09:05 +0200 Subject: [PATCH] Assert the merge walked alone is taken from its key at its own commit, since a cut records no ask (issue 1931) --- cmd/mesh-controller/batches_integration_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/mesh-controller/batches_integration_test.go b/cmd/mesh-controller/batches_integration_test.go index 1034ac65..1a17a2f7 100644 --- a/cmd/mesh-controller/batches_integration_test.go +++ b/cmd/mesh-controller/batches_integration_test.go @@ -343,7 +343,7 @@ func TestALateMergeIsAnsweredByTheWalkOfTheLaterOne(t *testing.T) { func TestAFailedWalkWalksItsEarlierMergesAlone(t *testing.T) { open := windowed(t) everyHeadWaits(t) - asked := asksWithPaths(t) + asksWithPaths(t) ctx := t.Context() // Made before the cut marks their modules seen, as merges are: walked again, they are news all the same. oldest := catalogueMerge("aaaa0001", "app", t0.Add(-3*time.Minute)) @@ -370,9 +370,10 @@ func TestAFailedWalkWalksItsEarlierMergesAlone(t *testing.T) { !sameMerge(alone.Delivery.Merges[0], inventory.PlanMerge{Repository: "novox/mesh-catalog", Commit: middle.Commit}) { t.Fatalf("the newest earlier merge was not walked alone on its own commit: %+v", alone) } - if _, in := alone.Modules["app"]; !in || (*asked)[len(*asked)-1] != [3]string{"novox/mesh-catalog", "modules/app", - middle.Commit} { - t.Fatalf("the merge walked alone does not build app at its own commit: %v, asked %v", alone.Modules, *asked) + // The cut takes the first tier from the builder's keys and asks no build, so nothing is recorded as asked: the + // module is taken from its key at the commit the merge was walked on. + if app := alone.Modules["app"]; app == nil || !app.Key || app.State != "asked" || app.KeyAt != middle.Commit { + t.Fatalf("the merge walked alone does not build app at its own commit: %v", alone.Modules) } // Retried, the failed walk would name merges the search answers now. if _, err := retryPlan(ctx, open, failed.ID); err == nil || !strings.Contains(err.Error(), "walked alone") {