RFR: 8369306: Implement invokeAndWait and finishTerminating on headless platform [v3]

Kevin Rushforth kcr at openjdk.org
Mon Oct 13 16:38:50 UTC 2025


On Mon, 13 Oct 2025 16:12:41 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> In general, I'm not a fan of adding hard-numbered sleep times. Either the expected events are delivered, or they are not (yet). The hard sleep pattern leads to either slowdowns or to failing tests on slow environments.
>> Using CountdownLatches and deterministic flows is much better for testing, imho.
>> Since the Util.sleep is widely used in other system tests, I'm ok with using it here as well -- but I still think it is a dangerous approach.
>
> I agree with @johanvos , it's always better to wait for the lock (with a timeout)

Better, sure, but it isn't always possible in practice. There are times where a delay is still needed.

This test now waits for the lock on the condition that will lead to the thread shutting down. Good. It's still necessary to sleep for a small time to be sure that it has.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1934#discussion_r2426823217


More information about the openjfx-dev mailing list