On Sat, 11 Oct 2025 08:52:12 GMT, Johan Vos <[email protected]> wrote:
>> I'm testing on an M1, but you are right, on different environments it could >> take longer. >> >> I've added now an exit latch from >> `PlatformImplShim.test_getPlatformExitLatch()`, so we wait whatever is >> needed until `PlatformImpl.tkExit()` finishes, and then those 10 ms should >> be more than enough (but we still need to wait a couple of ms nonetheless >> until the JavaFX thread is fully gone). > > 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) ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1934#discussion_r2426775608
