vertx-unit
vertx-unit copied to clipboard
An asynchronous operation called in doOnUnsubscribe after the async.complete() call is terminated
An asynchronous operation called in doOnUnsubscribe after the async.complete() call is terminated. The problem occurs in the tests, if async.complete () is called, then the asynchronous call in the doOnUnsubscribe is interrupted. This can be seen in these two tests.
@Test
public void otherTest1(TestContext context){
Async async = context.async();
Single.just(1).doOnUnsubscribe(() -> Single.just("MSG")
.delay(3, TimeUnit.SECONDS)
.subscribe(System.out::println))
.subscribe((i) -> async.complete(), context::fail);
async.awaitSuccess(5000);
}
@Test
public void otherTest2(TestContext context){
Async async = context.async();
Single.just(1).doOnUnsubscribe(() -> Single.just("MSG")
.delay(3, TimeUnit.SECONDS)
.subscribe(System.out::println))
.subscribe((i) -> System.out.println(i), context::fail);
async.await(5000);
}