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) }