Skip to content

Commit 001dc31

Browse files
authored
test(pubsub/v2): reduced flow controller test limits for 32 bit systems (#14238)
Reduces the flow controller test limits from 4GB -> 2GB, retaining the intent, but making this pass for 32 bit systems. The alternative would be to convert flow_controller to take an int64 explicitly instead, but since the test is rather trivial, I prefer to keep this as-is. Fixes #14235
1 parent 3422d73 commit 001dc31

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

pubsub/flow_controller_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ func TestFlowControllerUnboundedBytes(t *testing.T) {
226226
ctx := context.Background()
227227
fc := newFlowController(fcSettings(2, 0, FlowControlSignalError))
228228

229-
// Successfully acquire 4GB.
230-
if err := fc.acquire(ctx, 4e9); err != nil {
229+
// Successfully acquire 2GB.
230+
if err := fc.acquire(ctx, 2e9); err != nil {
231231
t.Errorf("got %v, wanted no error", err)
232232
}
233233

234-
// Successfully acquired 4GB bytes.
235-
if err := fc.acquire(ctx, 4e9); err != nil {
234+
// Successfully acquired 2GB bytes.
235+
if err := fc.acquire(ctx, 2e9); err != nil {
236236
t.Errorf("got %v, wanted no error", err)
237237
}
238238

pubsub/v2/flow_controller_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ func TestFlowControllerUnboundedBytes(t *testing.T) {
226226
ctx := context.Background()
227227
fc := newFlowController(fcSettings(2, 0, FlowControlSignalError))
228228

229-
// Successfully acquire 4GB.
230-
if err := fc.acquire(ctx, 4e9); err != nil {
229+
// Successfully acquire 2GB.
230+
if err := fc.acquire(ctx, 2e9); err != nil {
231231
t.Errorf("got %v, wanted no error", err)
232232
}
233233

234-
// Successfully acquired 4GB bytes.
235-
if err := fc.acquire(ctx, 4e9); err != nil {
234+
// Successfully acquired 2GB bytes.
235+
if err := fc.acquire(ctx, 2e9); err != nil {
236236
t.Errorf("got %v, wanted no error", err)
237237
}
238238

0 commit comments

Comments
 (0)