From 11815c0fb3b9796a2944e8acad537320d749cffb Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 21 Oct 2026 21:45:58 +0200 Subject: [PATCH] Have the delivery test's view hear a plan a verb let go, so a loaded machine cannot read it still waiting (issue 1399) --- cmd/mesh-controller/delivery_integration_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/mesh-controller/delivery_integration_test.go b/cmd/mesh-controller/delivery_integration_test.go index 399df3a8..a50bf4ec 100644 --- a/cmd/mesh-controller/delivery_integration_test.go +++ b/cmd/mesh-controller/delivery_integration_test.go @@ -59,6 +59,18 @@ func TestAMergeWaitsForItsDeliverysWordAndThePersonsWordWorksWithoutIt(t *testin } } + // heardOf has this mesh's own view of the plans take in the plan as the bucket holds it. A verb of the + // controller (deliveryCommand, plansCommand) opens an inventory of its own and writes the plan there; this + // mesh's inventory learns of the write from the bucket's watch, a moment later, and a loaded machine makes the + // moment long enough for advanceHeld to read the plan as it was, still waiting for its word, and ask nothing + // (issue 1399). Reading the plan from the bucket puts it into the view at once, with no wait to bound. + heardOf := func(id string) { + t.Helper() + if _, err := inv.PlanByID(ctx, id); err != nil { + t.Fatal(err) + } + } + // No holder on record: the merge starts its walk, as before. p := merge("c1aaaaaaaa", "modules/app/index.ts") if p.Waiting() || len(*asked) != 1 { @@ -90,6 +102,7 @@ func TestAMergeWaitsForItsDeliverysWordAndThePersonsWordWorksWithoutIt(t *testin if err := deliveryCommand(ctx, []string{"go", p.ID}); err == nil { t.Fatal("a walk was let go twice") } + heardOf(p.ID) advanceHeld(ctx, open) if len(*asked) != 2 { t.Fatalf("the word did not start the walk: %v", *asked) @@ -119,6 +132,7 @@ func TestAMergeWaitsForItsDeliverysWordAndThePersonsWordWorksWithoutIt(t *testin if err := plansCommand(ctx, []string{"go", p.ID, "--why", "mesh-delivery is down"}); err != nil { t.Fatal(err) } + heardOf(p.ID) advanceHeld(ctx, open) got, _ = inv.PlanByID(ctx, p.ID) if got.Waiting() || !strings.HasPrefix(got.Delivery.By, "a person") || len(*asked) < 4 {