Search in sources :

Example 1 with TimeOutObserver

use of io.reactivex.rxjava3.internal.operators.completable.CompletableTimeout.TimeOutObserver in project RxJava by ReactiveX.

the class CompletableTimeoutTest method ambRace.

@Test
public void ambRace() {
    TestObserver<Void> to = new TestObserver<>();
    to.onSubscribe(Disposable.empty());
    CompositeDisposable cd = new CompositeDisposable();
    AtomicBoolean once = new AtomicBoolean();
    TimeOutObserver a = new TimeOutObserver(cd, once, to);
    a.onComplete();
    a.onComplete();
    List<Throwable> errors = TestHelper.trackPluginErrors();
    try {
        a.onError(new TestException());
        TestHelper.assertUndeliverable(errors, 0, TestException.class);
    } finally {
        RxJavaPlugins.reset();
    }
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestException(io.reactivex.rxjava3.exceptions.TestException) TimeOutObserver(io.reactivex.rxjava3.internal.operators.completable.CompletableTimeout.TimeOutObserver) TestObserver(io.reactivex.rxjava3.observers.TestObserver) Test(org.junit.Test)

Aggregations

TestException (io.reactivex.rxjava3.exceptions.TestException)1 TimeOutObserver (io.reactivex.rxjava3.internal.operators.completable.CompletableTimeout.TimeOutObserver)1 TestObserver (io.reactivex.rxjava3.observers.TestObserver)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Test (org.junit.Test)1