MCPcopy Create free account
hub / github.com/ReactiveX/RxGo / Test_Observable_BackOffRetry_Error

Function Test_Observable_BackOffRetry_Error

observable_operator_test.go:228–240  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

226}
227
228func Test_Observable_BackOffRetry_Error(t *testing.T) {
229 defer goleak.VerifyNone(t)
230 ctx, cancel := context.WithCancel(context.Background())
231 defer cancel()
232 backOffCfg := backoff.NewExponentialBackOff()
233 backOffCfg.InitialInterval = time.Nanosecond
234 obs := Defer([]Producer{func(ctx context.Context, next chan<- Item) {
235 next <- Of(1)
236 next <- Of(2)
237 next <- Error(errFoo)
238 }}).BackOffRetry(backoff.WithMaxRetries(backOffCfg, 3))
239 Assert(ctx, t, obs, HasItems(1, 2, 1, 2, 1, 2, 1, 2), HasError(errFoo))
240}
241
242func Test_Observable_BufferWithCount(t *testing.T) {
243 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 7

DeferFunction · 0.85
OfFunction · 0.85
ErrorFunction · 0.85
AssertFunction · 0.85
HasItemsFunction · 0.85
HasErrorFunction · 0.85
BackOffRetryMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…