On Fri, 21 Jul 2023 18:06:22 GMT, Andy Goryachev <ango...@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

Reply via email to