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

Function Test_Observable_Retry

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

Source from the content-addressed store, hash-verified

1607}
1608
1609func Test_Observable_Retry(t *testing.T) {
1610 defer goleak.VerifyNone(t)
1611 ctx, cancel := context.WithCancel(context.Background())
1612 defer cancel()
1613 i := 0
1614 obs := Defer([]Producer{func(ctx context.Context, next chan<- Item) {
1615 next <- Of(1)
1616 next <- Of(2)
1617 if i == 2 {
1618 next <- Of(3)
1619 } else {
1620 i++
1621 next <- Error(errFoo)
1622 }
1623 }}).Retry(3, func(err error) bool {
1624 return true
1625 })
1626 Assert(ctx, t, obs, HasItems(1, 2, 1, 2, 1, 2, 3), HasNoError())
1627}
1628
1629func Test_Observable_Retry_Error_ShouldRetry(t *testing.T) {
1630 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
HasNoErrorFunction · 0.85
RetryMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…