Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-flake TestNoRaceJetStreamClusterGhostConsumers #5985

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made consistent with TestJetStreamClusterGhostEphemeralsAfterRestart now as well.

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