RFR: 8255248: NullPointerException in JFXPanel due to race condition in HostContainer [v3]

Andy Goryachev angorya at openjdk.org
Thu Aug 31 19:46:17 UTC 2023


On Fri, 21 Jul 2023 18:06:22 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Check FXEnabled initially
>
> tests/system/src/test/java/test/javafx/embed/swing/JFXPanelNPETest.java line 101:
> 
>> 99:             SwingUtilities.invokeLater(contentPane::repaint);
>> 100:             Platform.runLater(() -> contentPane.setScene(null));
>> 101:             Thread.sleep(100);
> 
> I would recommend replacing a fixed number with a random value.
> 
> (Typically, when a random is added to the test, it would make sense to print its seed to stdout, for the sake of reproducing a possible failure later; but in this case it might be unnecessary because we are dealing with multiple threads and that adds its own degree of randomness, completely eliminating reproducibility.  Or, perhaps, we still need to print the seed to maximize the probability of reproducing the failed scenario.)

Despite downvote, I still think randomness in the unit test is a good thing.

For more background, please take a look at the second answer in 
https://stackoverflow.com/questions/32458/random-data-in-unit-tests

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1178#discussion_r1312136125


More information about the openjfx-dev mailing list