(t *testing.T, nc *nats.Conn)
| 228 | } |
| 229 | |
| 230 | func waitForJSReady(t *testing.T, nc *nats.Conn) { |
| 231 | var err error |
| 232 | timeout := time.Now().Add(10 * time.Second) |
| 233 | for time.Now().Before(timeout) { |
| 234 | // Use a smaller MaxWait here since if it fails, we don't want |
| 235 | // to wait for too long since we are going to try again. |
| 236 | js, err := nc.JetStream(nats.MaxWait(250 * time.Millisecond)) |
| 237 | if err != nil { |
| 238 | t.Fatal(err) |
| 239 | } |
| 240 | _, err = js.AccountInfo() |
| 241 | if err != nil { |
| 242 | continue |
| 243 | } |
| 244 | return |
| 245 | } |
| 246 | t.Fatalf("Timeout waiting for JS to be ready: %v", err) |
| 247 | } |
| 248 | |
| 249 | func withJSClusterAndStream(t *testing.T, clusterName string, size int, stream jetstream.StreamConfig, tfn func(t *testing.T, subject string, srvs ...*jsServer)) { |
| 250 | t.Helper() |
no test coverage detected