On Tue, 17 Jun 2025 14:59:55 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 53: >> >>> 51: }); >>> 52: countDownLatch.await(); >>> 53: System.out.println("Test Passed"); >> >> @DamonGuy >> >> Test continues to run if the user does not click on Pass/Fail buttons. It >> can be avoided by adding a timeout for the countdown latch as below and >> calling disposeFrames() in finally block. >> >> Suggestion: >> >> countDownLatch = new CountDownLatch(1); >> try { >> EventQueue.invokeAndWait(() -> { >> createTestFrame(); >> createInstructionsFrame(); >> }); >> >> if (!countDownLatch.await(2, TimeUnit.MINUTES)) { >> throw new RuntimeException("Test timeout : No action was" >> + " taken on the test."); >> } >> System.out.println("Test passed."); >> } finally { >> EventQueue.invokeAndWait(ListDragCursor::disposeFrames); >> } > > I'm for introducing the timeout, thank you! > > The default timeout could be 5 minutes. Thanks! Implemented. >> test/jdk/java/awt/Cursor/CursorDragTest/ListDragCursor.java line 125: >> >>> 123: >>> 124: static void disposeFrames() { >>> 125: countDownLatch.countDown(); >> >> countDownLatch.countDown(); needs to be removed from disposeFrames(). > > ~~Why does it?~~ > > Got it! Pressing the buttons should just release the latch, then the main > method disposes of the frames. Understood. Updated! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152699472 PR Review Comment: https://git.openjdk.org/jdk/pull/25705#discussion_r2152703480