mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 10:10:42 -07:00
Stabilize test, wait a bit for migration
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -515,6 +515,11 @@ func (s *Server) migrateEphemerals() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gove time for migration information to make it out of our server.
|
||||
if len(consumers) > 0 {
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
// Shutdown jetstream for this server.
|
||||
|
||||
@@ -2098,6 +2098,7 @@ func TestJetStreamClusterEphemeralConsumersNotReplicated(t *testing.T) {
|
||||
t.Fatalf("Unexpected publish error: %v", err)
|
||||
}
|
||||
checkSubsPending(t, sub, 1)
|
||||
sub.NextMsg(0)
|
||||
|
||||
if ci.Cluster == nil || len(ci.Cluster.Replicas) != 0 {
|
||||
t.Fatalf("Expected ephemeral to be R=1, got %+v", ci.Cluster)
|
||||
@@ -2115,13 +2116,13 @@ func TestJetStreamClusterEphemeralConsumersNotReplicated(t *testing.T) {
|
||||
scl.Shutdown()
|
||||
c.waitOnStreamLeader("$G", "foo")
|
||||
|
||||
// Let the consumer migrate and spin up.
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
|
||||
if _, err = js.Publish("foo", []byte("OK")); err != nil {
|
||||
t.Fatalf("Unexpected publish error: %v", err)
|
||||
}
|
||||
checkSubsPending(t, sub, 2)
|
||||
|
||||
if _, err := sub.NextMsg(500 * time.Millisecond); err != nil {
|
||||
t.Logf("Expected to see another message, but behavior is optimistic so can fail")
|
||||
}
|
||||
}
|
||||
|
||||
func TestJetStreamClusterUserSnapshotAndRestore(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user