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

Function TestRetryTopic

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

Source from the content-addressed store, hash-verified

325}
326
327func TestRetryTopic(t *testing.T) {
328 // Test that Send is retried if the driver returns a retryable error.
329 ctx := context.Background()
330 ft := &failTopic{}
331 topic := NewTopic(ft, nil)
332 defer topic.Shutdown(ctx)
333 err := topic.Send(ctx, &Message{})
334 if err != nil {
335 t.Errorf("Send: got %v, want nil", err)
336 }
337 if got, want := ft.calls, nRetryCalls+1; got != want {
338 t.Errorf("calls: got %d, want %d", got, want)
339 }
340}
341
342var errRetry = errors.New("retry")
343

Callers

nothing calls this directly

Calls 3

ShutdownMethod · 0.95
SendMethod · 0.95
NewTopicFunction · 0.85

Tested by

no test coverage detected