Skip to content

Commit 621741b

Browse files
Fix Slow Non-deterministic Test
Somehow I missed the Thread.sleep to force the scenario so most of the time this test would run very slow (or forever). I'm surprised the unit tests passed before... just random luck on thread scheduling.
1 parent 69bc312 commit 621741b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ public void testErrorPropagatesWhenNoOutstandingRequests() {
687687

688688
@Override
689689
public void call(Notification<? super Long> n) {
690-
// System.out.println("BEFORE " + n);
690+
// System.out.println("BEFORE " + n);
691691
}
692692

693693
})
@@ -696,7 +696,11 @@ public void call(Notification<? super Long> n) {
696696

697697
@Override
698698
public void call(Notification<? super Long> n) {
699-
// System.out.println("AFTER " + n);
699+
try {
700+
Thread.sleep(100);
701+
} catch (InterruptedException e) {
702+
}
703+
// System.out.println("AFTER " + n);
700704
}
701705

702706
});

0 commit comments

Comments
 (0)