diff --git a/server/jetstream_cluster_3_test.go b/server/jetstream_cluster_3_test.go index 68b411bbcf1..446938ba54f 100644 --- a/server/jetstream_cluster_3_test.go +++ b/server/jetstream_cluster_3_test.go @@ -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) diff --git a/server/norace_test.go b/server/norace_test.go index 811167c69f7..5499cb3ae3b 100644 --- a/server/norace_test.go +++ b/server/norace_test.go @@ -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) @@ -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 }