Skip to content

Commit

Permalink
Need to wait on cluster ready
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed Sep 7, 2022
1 parent c3203a3 commit 5345393
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/jetstream_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3737,12 +3737,10 @@ func TestJetStreamClusterAccountPurge(t *testing.T) {
updateJwt(t, c.randomServer().ClientURL(), sysCreds, accJwt, 3)

createTestData := func(t *testing.T) {
nc := natsConnect(t, c.randomNonLeader().ClientURL(), nats.UserCredentials(accCreds))
nc, js := jsClientConnect(t, c.randomNonLeader(), nats.UserCredentials(accCreds))
defer nc.Close()

js, err := nc.JetStream()
require_NoError(t, err)
_, err = js.AddStream(&nats.StreamConfig{
_, err := js.AddStream(&nats.StreamConfig{
Name: "TEST1",
Subjects: []string{"foo"},
Replicas: 3,
Expand Down Expand Up @@ -3866,6 +3864,7 @@ func TestJetStreamClusterAccountPurge(t *testing.T) {
})

t.Run("purge-with-restart", func(t *testing.T) {
c.waitOnStreamLeader(accpub, "TEST1")
createTestData(t)
checkForDirs(t, 6, 4)
purge(t)
Expand Down

0 comments on commit 5345393

Please sign in to comment.