Skip to content

Commit cf63347

Browse files
committed
1.x: Give more time to OperatorSwitchTest.switchAsyncHeavily (#3897)
* 1.x: Give more time to OperatorSwitchTest.switchAsyncHeavily * Also print last seen how long time ago
1 parent 89fd2dd commit cf63347

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/java/rx/internal/operators/OperatorSwitchTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,12 +837,15 @@ public void switchAsyncHeavily() {
837837

838838
final Queue<Throwable> q = new ConcurrentLinkedQueue<Throwable>();
839839

840+
final long[] lastSeen = { 0L };
841+
840842
final int j = i;
841843
TestSubscriber<Integer> ts = new TestSubscriber<Integer>(i) {
842844
int count;
843845
@Override
844846
public void onNext(Integer t) {
845847
super.onNext(t);
848+
lastSeen[0] = System.currentTimeMillis();
846849
if (++count == j) {
847850
count = 0;
848851
requestMore(j);
@@ -867,13 +870,13 @@ public void call(Throwable e) {
867870
.timeout(10, TimeUnit.SECONDS)
868871
.subscribe(ts);
869872

870-
ts.awaitTerminalEvent(30, TimeUnit.SECONDS);
873+
ts.awaitTerminalEvent(45, TimeUnit.SECONDS);
871874
if (!q.isEmpty()) {
872875
throw new AssertionError("Dropped exceptions", new CompositeException(q));
873876
}
874877
ts.assertNoErrors();
875878
if (ts.getOnCompletedEvents().size() == 0) {
876-
fail("switchAsyncHeavily timed out @ " + j + " (" + ts.getOnNextEvents().size() + " onNexts received)");
879+
fail("switchAsyncHeavily timed out @ " + j + " (" + ts.getOnNextEvents().size() + " onNexts received, last was " + (System.currentTimeMillis() - lastSeen[0]) + " ms ago");
877880
}
878881
}
879882
}

0 commit comments

Comments
 (0)