Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Flaky CancellationTest #2731

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void cancel() {
private static final CharSequence TEST_DATA = newLargePayload();

@RegisterExtension
final ExecutorExtension<Executor> execRule = ExecutorExtension.withCachedExecutor();
static final ExecutorExtension<Executor> execRule = ExecutorExtension.withCachedExecutor().setClassLevel(true);

@Mock
private HttpServiceContext ctx;
Expand Down Expand Up @@ -225,7 +225,7 @@ private void testCancelResponseSingle(final StreamingHttpRequest req,
).flatMap(identity())
.beforeOnError((err) -> {
// Ignore racy cancellation, it's ordered safely.
if (!(err instanceof IllegalStateException)) {
if (!(err instanceof IllegalStateException || err instanceof InterruptedException)) {
errorRef.compareAndSet(null, err);
}
})
Expand All @@ -250,7 +250,7 @@ public void onSuccess(@Nullable final StreamingHttpResponse result) {
@Override
public void onError(final Throwable t) {
// Ignore racy cancellation, it's ordered safely.
if (!(t instanceof IllegalStateException)) {
if (!(t instanceof IllegalStateException || t instanceof InterruptedException)) {
errorRef.compareAndSet(null, t);
}
cancelledLatch.countDown();
Expand Down