Skip to content

Instantly share code, notes, and snippets.

@steliosfran
Created August 1, 2021 11:59
Show Gist options
  • Save steliosfran/69a84413c963adbd5f01e076eb0cbff2 to your computer and use it in GitHub Desktop.
Save steliosfran/69a84413c963adbd5f01e076eb0cbff2 to your computer and use it in GitHub Desktop.
@Test
fun `then the merged stream does not crash`() {
val waiter = Waiter()
RxJavaPlugins.setErrorHandler {
// Fail the test if we receive an exception in the error handler
waiter.fail("Error handler received an exception: $it")
}
Completable.mergeArray(completable1, completable2).test().await()
Timer().schedule(10) {
// Pass the test after 10ms if we don't receive an exception
waiter.resume()
}
// Await for waiter.resume() or waiter.fail()
waiter.await()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment