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 <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2022-03-17 19:53:33 -06:00
parent a23b1b73ef
commit ac52ecd9ff
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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)
}
}