While working on the systemtests for the Headless platform, I noticed
timing issues with the Marlin QPath Test. Those have nothing to do with
Marlin, but rather with the lifecycle. After the test ran,
`test.util.Shutdown` is invoked (not on the JavaFX app thread). I noticed
that this caused a timeout almost always when running the systemtest with
the headless platform, and almost never when running with the regular (Gtk)
platform.
The problem is that the `test.util.Shutdown` method is invoking
Platform.runLater() but in some cases (almost always in Headless and almost
never in GTK) the runLater is not accepting runnables anymore. This happens
because of the PlatformImpl.checkIdle which will shutdown the platform in
case there are no windows and no pending runnables (and a few more
conditions). This check runs on the JavaFX app thread, and it might trigger
`tkExit` before the test-thread invokes `test.util.Shutdown`.

There are a number of ways to solve this, e.g.
* get rid of the separate shutdown procedure in the system tests.
* set Platform.setImplicitExit(false) which will prevent tkExit being
called when the last window is gone
* add more safety in test.util.Shutdown so that it doesn't try to use the
FX App thread when that is not accepting new runnables
* ...

Thoughts?

- Johan

Reply via email to