Allow max and max/2 for edge conditions

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2018-07-02 14:29:29 -07:00
parent 85c2edc314
commit f7241aa435

View File

@@ -1006,8 +1006,8 @@ func TestDynamicBuffers(t *testing.T) {
nc.Flush()
m := stopRecording()
if m.rsz != maxBufSize {
t.Fatalf("Expected read buffer of %d, but got %d\n", maxBufSize, m.rsz)
if m.rsz != maxBufSize && m.rsz != maxBufSize/2 {
t.Fatalf("Expected read buffer of %d or %d, but got %d\n", maxBufSize, maxBufSize/2, m.rsz)
}
if m.wsz > startBufSize {
t.Fatalf("Expected write buffer of <= %d, but got %d\n", startBufSize, m.wsz)