From 72bcf2087054f7329174b252c81ed89b204653fa Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 3 Nov 2026 14:02:01 +0100 Subject: [PATCH] The bus module's integration test publishes the backup's end at once: the node agent hears it before it asks, so no sleep (review round 1, finding 5) --- cmd/mesh-host/nodeagent_integration_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/mesh-host/nodeagent_integration_test.go b/cmd/mesh-host/nodeagent_integration_test.go index ba61810..cecee45 100644 --- a/cmd/mesh-host/nodeagent_integration_test.go +++ b/cmd/mesh-host/nodeagent_integration_test.go @@ -807,11 +807,9 @@ func TestNatsTheBusServerIsTakenOverAndReplacedOnlyWhenItsBuildChangesIt(t *test backupsMu.Lock() backups = append(backups, string(got)) backupsMu.Unlock() + // The node agent hears the backup's end before it asks (backupNode), so the event follows the answer at once. _ = m.Respond([]byte(`{"result":{"started":true}}`)) - go func() { - time.Sleep(20 * time.Millisecond) - _ = b.conn.Publish(backedUpEvent, backupEvent(itNode, "nats", true, time.Now(), "")) - }() + _ = b.conn.Publish(backedUpEvent, backupEvent(itNode, "nats", true, time.Now(), "")) }); err != nil { t.Fatal(err) }