(t *testing.T)
| 368 | func (*failTopic) Close() error { return nil } |
| 369 | |
| 370 | func TestRetryReceive(t *testing.T) { |
| 371 | ctx := context.Background() |
| 372 | fs := &failSub{fail: true} |
| 373 | sub := NewSubscription(fs, nil, nil) |
| 374 | defer sub.Shutdown(ctx) |
| 375 | m, err := sub.Receive(ctx) |
| 376 | if err != nil { |
| 377 | t.Fatalf("Receive: got %v, want nil", err) |
| 378 | } |
| 379 | m.Ack() |
| 380 | if got, want := fs.calls, nRetryCalls+1; got != want { |
| 381 | t.Errorf("calls: got %d, want %d", got, want) |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | // TestBatchSizeDecay verifies that the batch size decays when no messages are available. |
| 386 | // (see https://github.com/google/go-cloud/issues/2849). |
nothing calls this directly
no test coverage detected