(t *testing.T, nodes []*jsServer, size int)
| 6579 | } |
| 6580 | |
| 6581 | func waitForJSClusterReady(t *testing.T, nodes []*jsServer, size int) { |
| 6582 | t.Helper() |
| 6583 | timeout := time.Now().Add(10 * time.Second) |
| 6584 | for time.Now().Before(timeout) { |
| 6585 | for _, n := range nodes { |
| 6586 | if n.JetStreamIsLeader() && len(n.JetStreamClusterPeers()) == size { |
| 6587 | return |
| 6588 | } |
| 6589 | } |
| 6590 | time.Sleep(50 * time.Millisecond) |
| 6591 | } |
| 6592 | t.Fatalf("Timeout waiting for JS cluster of size %d to be ready", size) |
| 6593 | } |
| 6594 | |
| 6595 | func checkFor(t *testing.T, totalWait, sleepDur time.Duration, f func() error) { |
| 6596 | t.Helper() |
no test coverage detected