From ac52ecd9ffe49c3d443bcb24951abfa40f111d99 Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Thu, 17 Mar 2022 19:53:33 -0600 Subject: [PATCH] Fixing flapper Since acks are now processed in different go-routine, the tests that use Ack() cannot expect the number of ack messages to be exact immediately. So in this test use AckSync() to ensure that the ack is processed. Alternatively, the pending count should be checked with a checkFor(). Signed-off-by: Ivan Kozlovic --- server/const.go | 2 +- server/jetstream_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/const.go b/server/const.go index 301a813c..b625ef4f 100644 --- a/server/const.go +++ b/server/const.go @@ -41,7 +41,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.7.5-beta.2" + VERSION = "2.7.5-beta.3" // PROTO is the currently supported protocol. // 0 was the original diff --git a/server/jetstream_test.go b/server/jetstream_test.go index dee506d2..414be538 100644 --- a/server/jetstream_test.go +++ b/server/jetstream_test.go @@ -16054,7 +16054,7 @@ func TestJetStreamConsumerAckSampling(t *testing.T) { mp := 0 for _, m := range fetchMsgs(t, asub, total, time.Second) { - err = m.Ack() + err = m.AckSync() require_NoError(t, err) mp++ } @@ -16068,7 +16068,7 @@ func TestJetStreamConsumerAckSampling(t *testing.T) { require_NoError(t, err) // Should be ~250 - if nmsgs < 100 || nmsgs > 400 { + if nmsgs < 200 || nmsgs > 300 { t.Fatalf("Expected about 250, got %d", nmsgs) } }