mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 11:48:43 -07:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user