Skip to content

Commit

Permalink
8224024: java/util/concurrent/BlockingQueue/DrainToFails.java testBou…
Browse files Browse the repository at this point in the history
…nded fails intermittently

Reviewed-by: martin
  • Loading branch information
Doug Lea committed May 24, 2019
1 parent 5892b06 commit 22a4313
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/jdk/java/util/concurrent/BlockingQueue/DrainToFails.java
Expand Up @@ -35,6 +35,7 @@
/*
* @test
* @summary Test drainTo failing due to c.add throwing
* @library /test/lib
*/

import java.util.ArrayList;
Expand All @@ -50,9 +51,11 @@
import java.util.concurrent.RunnableScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import jdk.test.lib.Utils;

@SuppressWarnings({"unchecked", "rawtypes"})
public class DrainToFails {
static final long LONG_DELAY_MS = Utils.adjustTimeout(10_000);
final int CAPACITY = 10;
final int SMALL = 2;

Expand Down Expand Up @@ -169,7 +172,7 @@ void testBounded(final BlockingQueue q) throws Throwable {
fail("should throw");
} catch (IllegalStateException success) {
for (Thread putter : putters) {
putter.join(2000L);
putter.join(LONG_DELAY_MS);
check(! putter.isAlive());
}
assertContentsInOrder(q2, 2, 3);
Expand All @@ -183,11 +186,10 @@ void testBounded(final BlockingQueue q) throws Throwable {
}
}

Runnable putter(final BlockingQueue q, final int elt) {
return new Runnable() {
public void run() {
try { q.put(elt); }
catch (Throwable t) { unexpected(t); }}};
Runnable putter(BlockingQueue q, int elt) {
return () -> {
try { q.put(elt); }
catch (Throwable t) { unexpected(t); }};
}

void assertContentsInOrder(Iterable it, Object... contents) {
Expand Down

2 comments on commit 22a4313

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 22a4313 Feb 13, 2023

Choose a reason for hiding this comment

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

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 22a4313 Feb 13, 2023

Choose a reason for hiding this comment

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

@GoeLin the backport was successfully created on the branch GoeLin-backport-22a4313e in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 22a4313e from the openjdk/jdk repository.

The commit being backported was authored by Doug Lea on 24 May 2019 and was reviewed by Martin Buchholz.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev GoeLin-backport-22a4313e:GoeLin-backport-22a4313e
$ git checkout GoeLin-backport-22a4313e
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev GoeLin-backport-22a4313e

Please sign in to comment.