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)

This commit is contained in:
2026-11-03 14:02:01 +01:00
parent b47668421f
commit 72bcf20870
+2 -4
View File
@@ -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)
}