RFR: 8113: Make JfrWizardTest.verifyMinimalRecordingEventSettings work again
Christoph Langer
clanger at openjdk.org
Thu Jul 27 10:34:47 UTC 2023
On Tue, 25 Jul 2023 04:08:04 GMT, Vincent Alexander Beelte <duke at openjdk.org> wrote:
> One test I see failing all the time when I run the ui tests for my other pull requst is JfrWizardTest.verifyMinimalRecordingEventSettings.
>
> It looks to my like the issue is that the event groups must have chaged from when the test was written.
> Here is what that looks like currently for me on Windows with a jdk 17.0.7
> 
> The Java Development Kit group is not explicitly disabled by the test and so it always fails when it tries to assert that only the "Flight Recorder">"Recording Setting" Event is enabled.
>
> I changed the test so that is does not need to explicitly disable other groups by name. I think even if for some reason this test failing is a result of my setup on this computer, this way is more robust to changes in the groups.
Some style comments. Please also update copyright years.
application/uitests/org.openjdk.jmc.test.jemmy/src/main/java/org/openjdk/jmc/test/jemmy/misc/wrappers/JfrWizard.java line 465:
> 463: final var eventSettingsTree = getEventSettingsTree();
> 464: final var names = eventSettingsTree.getAllItemTexts();
> 465: for (var name : names) {
You could simply do `for (var name : getEventSettingsTree().getAllItemTexts()) {` here
application/uitests/org.openjdk.jmc.test.jemmy/src/main/java/org/openjdk/jmc/test/jemmy/misc/wrappers/JfrWizard.java line 467:
> 465: for (var name : names) {
> 466: final var currentPath = name.toArray(String[]::new);
> 467: setEventSetting(!desiredState, settingName, currentPath);
Also here: `setEventSetting(!desiredState, settingName, name.toArray(String[]::new));`
application/uitests/org.openjdk.jmc.test.jemmy/src/main/java/org/openjdk/jmc/test/jemmy/misc/wrappers/JfrWizard.java line 469:
> 467: setEventSetting(!desiredState, settingName, currentPath);
> 468: }
> 469: }
Why are you using these additional block braces here?
-------------
PR Review: https://git.openjdk.org/jmc/pull/509#pullrequestreview-1549533091
PR Review Comment: https://git.openjdk.org/jmc/pull/509#discussion_r1276085468
PR Review Comment: https://git.openjdk.org/jmc/pull/509#discussion_r1276087078
PR Review Comment: https://git.openjdk.org/jmc/pull/509#discussion_r1276084661
More information about the jmc-dev
mailing list