On Mon, 24 Nov 2025 17:31:20 GMT, Viktor Klang <[email protected]> wrote:

> Adds the patch by @DougLea

test/jdk/java/util/concurrent/BlockingQueue/MissedPoll.java line 46:

> 44:         try (var pool = Executors.newCachedThreadPool()) {
> 45:             var futures = new ArrayList<Future<Integer>>();
> 46:             var phaser = new Phaser(4);

@DougLea Would it make sense to do the following, and then only keep a single 
`phaser.arriveAndAwaitAdvance();` ? (and skip the explicit q.clear())

Suggestion:

            var phaser = new Phaser(4) {
                @Override
                protected boolean onAdvance(int phase, int registeredParties) {
                    q.clear();
                    return super.onAdvance(phase, registeredParties);
                }
            };

test/jdk/java/util/concurrent/BlockingQueue/MissedPoll.java line 68:

> 66:                 if (future.get() != 0)
> 67:                     throw new Error();
> 68:             }

@DougLea It might make sense to assert/verify that the queue is empty at the 
end of the test?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28479#discussion_r2557165668
PR Review Comment: https://git.openjdk.org/jdk/pull/28479#discussion_r2557168125

Reply via email to