MCPcopy Create free account
hub / github.com/google/go-cloud / TestRetryReceive

Function TestRetryReceive

pubsub/pubsub_test.go:370–383  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

368func (*failTopic) Close() error { return nil }
369
370func 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).

Callers

nothing calls this directly

Calls 4

ShutdownMethod · 0.95
ReceiveMethod · 0.95
NewSubscriptionFunction · 0.85
AckMethod · 0.65

Tested by

no test coverage detected