mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Refactor outbound queues, remove dynamic sizing, add buffer reuse
Also try to reduce flakiness of `TestClusterQueueSubs` and `TestCrossAccountServiceResponseTypes`
This commit is contained in:
@@ -240,6 +240,10 @@ func TestClusterQueueSubs(t *testing.T) {
|
||||
sendB("PING\r\n")
|
||||
expectB(pongRe)
|
||||
|
||||
// Give plenty of time for the messages to flush, so that we don't
|
||||
// accidentally only read some of them.
|
||||
time.Sleep(time.Millisecond * 250)
|
||||
|
||||
// Should receive 5.
|
||||
matches = expectMsgsA(5)
|
||||
checkForQueueSid(t, matches, qg1SidsA)
|
||||
@@ -248,6 +252,10 @@ func TestClusterQueueSubs(t *testing.T) {
|
||||
// Send to A
|
||||
sendA("PUB foo 2\r\nok\r\n")
|
||||
|
||||
// Give plenty of time for the messages to flush, so that we don't
|
||||
// accidentally only read some of them.
|
||||
time.Sleep(time.Millisecond * 250)
|
||||
|
||||
// Should receive 5.
|
||||
matches = expectMsgsA(5)
|
||||
checkForQueueSid(t, matches, qg1SidsA)
|
||||
@@ -270,6 +278,10 @@ func TestClusterQueueSubs(t *testing.T) {
|
||||
// Send to B
|
||||
sendB("PUB foo 2\r\nok\r\n")
|
||||
|
||||
// Give plenty of time for the messages to flush, so that we don't
|
||||
// accidentally only read some of them.
|
||||
time.Sleep(time.Millisecond * 250)
|
||||
|
||||
// Should receive 1 from B.
|
||||
matches = expectMsgsB(1)
|
||||
checkForQueueSid(t, matches, qg2SidsB)
|
||||
@@ -308,6 +320,10 @@ func TestClusterQueueSubs(t *testing.T) {
|
||||
// Send to A
|
||||
sendA("PUB foo 2\r\nok\r\n")
|
||||
|
||||
// Give plenty of time for the messages to flush, so that we don't
|
||||
// accidentally only read some of them.
|
||||
time.Sleep(time.Millisecond * 250)
|
||||
|
||||
// Should receive 4 now.
|
||||
matches = expectMsgsA(4)
|
||||
checkForPubSids(t, matches, pSids)
|
||||
|
||||
Reference in New Issue
Block a user