From 1ec27e6ba18f1e3e1b59bbf907237b2ca45a9602 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 18 Oct 2026 21:24:07 +0200 Subject: [PATCH] Read tier 1's build and the note once the plan has reached them in the silent middle tier test (issue 1160) --- .../silent_mid_tier_integration_test.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmd/mesh-controller/silent_mid_tier_integration_test.go b/cmd/mesh-controller/silent_mid_tier_integration_test.go index 645c908b..ac0a465e 100644 --- a/cmd/mesh-controller/silent_mid_tier_integration_test.go +++ b/cmd/mesh-controller/silent_mid_tier_integration_test.go @@ -185,10 +185,20 @@ func TestAPlanPassesATierWhoseMachineNeverReportsAfterTheBoundAndSendsTheNextToT if got := plan().Tier; got != 0 { t.Fatalf("1160/AC5: the plan went on to tier %d before the bound, with laptop not heard from", got) } - eventually(t, "tier 1 asked once laptop's key expired", func() bool { return plan().Tier == 1 }) - if note := plan().Note; !strings.Contains(note, "laptop") || strings.Contains(note, "anchor") { - t.Errorf("1160/AC5: the plan says %q; want laptop named silent and not anchor", note) + // The note of the move to tier 1 is read in the step that sees it: later steps of the tier say their own. + var moved string + eventually(t, "tier 1 passed once laptop's key expired", func() bool { + if q := plan(); q.Tier == 1 { + moved = q.Note + return true + } + return false + }) + if !strings.Contains(moved, "laptop") || strings.Contains(moved, "anchor") { + t.Errorf("1160/AC5: the plan says %q; want laptop named silent and not anchor", moved) } + // The ask for tier 1's build is the next step, and records its build id on the module. + eventually(t, "tier 1 asked", func() bool { m := plan().Modules["b"]; return m != nil && m.Build != "" }) b := plan().Modules["b"] askedAt, _ := link.BuildAskedAt(b.Build) record(b.Build, "b", "c2", askedAt)