Skip to content

Commit

Permalink
Filter out missed racy close on CancellationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
tkountis committed Apr 15, 2021
1 parent 6df4265 commit 8541fda
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,12 @@ private void testCancelResponseSingle(final StreamingHttpRequest req,
Single<StreamingHttpResponse> respSingle = execRule.executor().submit(() ->
jerseyRouter.handle(ctx, req, HTTP_REQ_RES_FACTORY)
).flatMap(identity())
.beforeOnError(errorRef::set)
.beforeOnError((err) -> {
// Ignore racy cancellation, it's ordered safely.
if (!(err instanceof IllegalStateException)) {
errorRef.compareAndSet(null, err);
}
})
.afterCancel(cancelledLatch::countDown);

toSource(respSingle).subscribe(new SingleSource.Subscriber<StreamingHttpResponse>() {
Expand Down

0 comments on commit 8541fda

Please sign in to comment.