diff --git a/cmd/mesh-controller/composed_served_integration_test.go b/cmd/mesh-controller/composed_served_integration_test.go index 01c1b2b9..c33dcd60 100644 --- a/cmd/mesh-controller/composed_served_integration_test.go +++ b/cmd/mesh-controller/composed_served_integration_test.go @@ -431,9 +431,12 @@ func TestServedADoneKeyIsComposedAndGranted(t *testing.T) { t.Fatal(err) } gk, _ := sdkdelivery.ControllerGrantKey("board", fp) - if _, err := grants.Get(ctx, gk); err != nil { - t.Errorf("grants.%s is not written: %v", gk, err) - } + // The take-in writes the grant after the compositions (composed_keys.go), so it is waited for, not read in the instant + // the composition shows: a loaded build node read it a moment early (issue 1945). + becomes(t, 10*time.Second, "grants."+gk+" written", func() bool { + _, err := grants.Get(ctx, gk) + return err == nil + }) if n := m.declarationsSent(t); n != 0 { t.Errorf("%d declarations were sent", n) }