Skip to content

Commit

Permalink
Fix flapping tests
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed Feb 28, 2023
1 parent bab10c1 commit ccae674
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
6 changes: 1 addition & 5 deletions server/jetstream_cluster_3_test.go
Expand Up @@ -2742,11 +2742,7 @@ func TestJetStreamClusterInterestPolicyEphemeral(t *testing.T) {
// This happens only if we start publishing messages after consumer was created.
go func() {
for i := 0; i < msgs; i++ {
js.PublishAsync(test.subject, []byte("DATA"))
}
select {
case <-js.PublishAsyncComplete():
case <-time.After(5 * inactiveThreshold):
js.Publish(test.subject, []byte("DATA"))
}
}()

Expand Down
7 changes: 1 addition & 6 deletions server/jetstream_super_cluster_test.go
Expand Up @@ -2082,14 +2082,9 @@ func TestJetStreamSuperClusterMovingStreamAndMoveBack(t *testing.T) {

toSend := 10_000
for i := 0; i < toSend; i++ {
_, err := js.PublishAsync("TEST", []byte("HELLO WORLD"))
_, err := js.Publish("TEST", []byte("HELLO WORLD"))
require_NoError(t, err)
}
select {
case <-js.PublishAsyncComplete():
case <-time.After(5 * time.Second):
t.Fatalf("Did not receive completion signal")
}

_, err = js.UpdateStream(&nats.StreamConfig{
Name: "TEST",
Expand Down

0 comments on commit ccae674

Please sign in to comment.