Skip to content

Commit 070e42a

Browse files
committed
Reduce test failure likelihood of testMultiThreadedWithNPEinMiddle
1 parent c833083 commit 070e42a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/rx/observers/SerializedObserverTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ public TestMultiThreadedObservable(String... values) {
674674

675675
@Override
676676
public void call(final Subscriber<? super String> observer) {
677+
final NullPointerException npe = new NullPointerException();
677678
System.out.println("TestMultiThreadedObservable subscribed to ...");
678679
t = new Thread(new Runnable() {
679680

@@ -694,7 +695,7 @@ public void run() {
694695
System.out.println("TestMultiThreadedObservable onNext: " + s + " on thread " + Thread.currentThread().getName());
695696
if (s == null) {
696697
// force an error
697-
throw new NullPointerException();
698+
throw npe;
698699
} else {
699700
// allow the exception to queue up
700701
int sleep = (fj % 3) * 10;

0 commit comments

Comments
 (0)