Refactor outbound queues, remove dynamic sizing, add buffer reuse

Also try to reduce flakiness of `TestClusterQueueSubs` and `TestCrossAccountServiceResponseTypes`
This commit is contained in:
Neil Twigg
2022-12-20 16:47:31 +00:00
parent 3d5960f069
commit e4b6ba2f23
5 changed files with 263 additions and 258 deletions

View File

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