use of io.reactivex.internal.subscribers.StrictSubscriber in project RxJava by ReactiveX.
the class FlowableStrictTest method badRequestOnNextRace.
@Test
public void badRequestOnNextRace() {
for (int i = 0; i < 500; i++) {
TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
final PublishProcessor<Integer> pp = PublishProcessor.create();
final StrictSubscriber<Integer> s = new StrictSubscriber<Integer>(ts);
s.onSubscribe(new BooleanSubscription());
Runnable r1 = new Runnable() {
@Override
public void run() {
pp.onNext(1);
}
};
Runnable r2 = new Runnable() {
@Override
public void run() {
s.request(0);
}
};
TestHelper.race(r1, r2);
if (ts.valueCount() == 0) {
ts.assertFailure(IllegalArgumentException.class);
} else {
ts.assertValue(1).assertNoErrors().assertNotComplete();
}
}
}
Aggregations