Skip to content

Commit

Permalink
De-flake TestJetStreamClusterRedeliverBackoffs (#6331)
Browse files Browse the repository at this point in the history
`TestJetStreamClusterRedeliverBackoffs` would sometimes fail, even
though it would be very close to the intended backoff:
```
jetstream_cluster_2_test.go:4216: Timing is off for 1, expected ~100ms, but got 99.846642ms
jetstream_cluster_2_test.go:4216: Timing is off for 0, expected ~25ms, but got 50.767748ms
jetstream_cluster_2_test.go:4216: Timing is off for 4, expected ~250ms, but got 249.95211ms
```

Allowing for a bit of leeway on both ends.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
  • Loading branch information
derekcollison authored and MauriceVanVeen committed Jan 9, 2025
1 parent 7ead834 commit 7b0b08c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/jetstream_cluster_2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4219,7 +4219,7 @@ func TestJetStreamClusterRedeliverBackoffs(t *testing.T) {
d := tr.Sub(start)
// Adjust start for next calcs.
start = start.Add(d)
if d < expected[i] || d > expected[i]*2 {
if d < expected[i]-5*time.Millisecond || d > expected[i]*2+5*time.Millisecond {
t.Fatalf("Timing is off for %d, expected ~%v, but got %v", i, expected[i], d)
}
}
Expand Down

0 comments on commit 7b0b08c

Please sign in to comment.