Closed
Description
The following test fails once when mapping 3 values. The subscribe only receives 2 values.
final AtomicBoolean isFirst = new AtomicBoolean(true);
Observable.<Long> just(1L, 2L, 3L).map((Long x) -> {
System.out.println("map " + x);
if (x == 2 && isFirst.getAndSet(false)) {
throw new RuntimeException("retryable error");
}
return x;
})
.retry((i, t) -> {return true;})
.forEach(System.out::println);
output
map 1
1
map 2
map 3
3
When you replace .retry((i, t) -> {return true;})
with the retry infinite retry()
then the output looks like this...
map 1
1
map 2
map 1
1
map 2
2
map 3
3