Skip to content

Commit 3c2286f

Browse files
derekcollisonMauriceVanVeen
authored andcommitted
De-flake TestJetStreamNextMsgNoInterest (#6334)
Ack state could take some time to propagate, since the sent acks are not synchronous. Signed-off-by: Maurice van Veen <[email protected]>
1 parent 244df91 commit 3c2286f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

server/jetstream_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8536,10 +8536,14 @@ func TestJetStreamNextMsgNoInterest(t *testing.T) {
85368536
}
85378537
}
85388538
nc.Flush()
8539-
ostate := o.info()
8540-
if ostate.AckFloor.Stream != 11 || ostate.NumAckPending > 0 {
8541-
t.Fatalf("Inconsistent ack state: %+v", ostate)
8542-
}
8539+
8540+
checkFor(t, time.Second, 10*time.Millisecond, func() error {
8541+
ostate := o.info()
8542+
if ostate.AckFloor.Stream != 11 || ostate.NumAckPending > 0 {
8543+
return fmt.Errorf("Inconsistent ack state: %+v", ostate)
8544+
}
8545+
return nil
8546+
})
85438547
})
85448548
}
85458549
}

0 commit comments

Comments
 (0)