Skip to content

Commit

Permalink
De-flake TestNoRaceJetStreamClusterGhostConsumers (#5985)
Browse files Browse the repository at this point in the history
Consumer removal has exponential backoff starting from `startInterval`
moving all the way up to max 5 minutes. This lowers that max for these
tests.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
  • Loading branch information
derekcollison authored Oct 15, 2024
2 parents 1ded578 + 06fda16 commit a39bcf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions server/jetstream_cluster_3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1601,8 +1601,10 @@ func TestJetStreamClusterParallelConsumerCreation(t *testing.T) {

func TestJetStreamClusterGhostEphemeralsAfterRestart(t *testing.T) {
consumerNotActiveStartInterval = time.Second
consumerNotActiveMaxInterval = time.Second
defer func() {
consumerNotActiveStartInterval = defaultConsumerNotActiveStartInterval
consumerNotActiveMaxInterval = defaultConsumerNotActiveMaxInterval
}()

c := createJetStreamClusterExplicit(t, "R3S", 3)
Expand Down
8 changes: 6 additions & 2 deletions server/norace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6578,8 +6578,10 @@ func TestNoRaceJetStreamConsumerCreateTimeNumPending(t *testing.T) {

func TestNoRaceJetStreamClusterGhostConsumers(t *testing.T) {
consumerNotActiveStartInterval = time.Second
consumerNotActiveMaxInterval = time.Second
defer func() {
consumerNotActiveStartInterval = defaultConsumerNotActiveStartInterval
consumerNotActiveMaxInterval = defaultConsumerNotActiveMaxInterval
}()

c := createJetStreamClusterExplicit(t, "GHOST", 3)
Expand Down Expand Up @@ -6675,8 +6677,10 @@ func TestNoRaceJetStreamClusterGhostConsumers(t *testing.T) {
time.Sleep(5 * time.Second)
cancel()

checkFor(t, 30*time.Second, time.Second, func() error {
m, err := nc.Request("$JS.API.CONSUMER.LIST.TEST", nil, time.Second)
subj := fmt.Sprintf(JSApiConsumerListT, "TEST")
checkFor(t, 20*time.Second, 200*time.Millisecond, func() error {
// Request will take at most 4 seconds if some consumers can't be found.
m, err := nc.Request(subj, nil, 5*time.Second)
if err != nil {
return err
}
Expand Down

0 comments on commit a39bcf9

Please sign in to comment.