Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk17 Public archive

Commit

Permalink
8268080: java/util/concurrent/forkjoin/AsyncShutdownNow.java fails wi…
Browse files Browse the repository at this point in the history
…th java.util.concurrent.RejectedExecutionException

Co-authored-by: Doug Lea <dl@openjdk.org>
Reviewed-by: chegar, dfuchs
  • Loading branch information
Julia Boes and Doug Lea committed Jun 17, 2021
1 parent 4c9aefd commit 344e3ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions test/jdk/java/util/concurrent/forkjoin/AsyncShutdownNow.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -38,6 +38,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -102,7 +103,7 @@ public void testFutureGet(ExecutorService executor) throws Exception {
try {
future.get();
assertTrue(false);
} catch (ExecutionException e) {
} catch (ExecutionException | RejectedExecutionException e) {
// expected
}
} finally {
Expand All @@ -123,7 +124,7 @@ public void testTimedFutureGet(ExecutorService executor) throws Exception {
try {
future.get(1, TimeUnit.HOURS);
assertTrue(false);
} catch (ExecutionException e) {
} catch (ExecutionException | RejectedExecutionException e) {
// expected
}
} finally {
Expand Down Expand Up @@ -167,7 +168,7 @@ public void testInvokeAny(ExecutorService executor) throws Exception {
// execute long running tasks
executor.invokeAny(List.of(SLEEP_FOR_A_DAY, SLEEP_FOR_A_DAY));
assertTrue(false);
} catch (ExecutionException e) {
} catch (ExecutionException | RejectedExecutionException e) {
// expected
}
} finally {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,6 +36,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -89,7 +90,7 @@ public void testInvokeAny() throws Exception {
// execute long running tasks
pool.invokeAny(List.of(SLEEP_FOR_A_DAY, SLEEP_FOR_A_DAY));
assertTrue(false);
} catch (ExecutionException e) {
} catch (ExecutionException | RejectedExecutionException e) {
// expected
}
} finally {
Expand Down

1 comment on commit 344e3ed

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.