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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user