RFR: 7063: JfrThreadsPageTest (UI-test) fails
Alex Macdonald
aptmac at openjdk.java.net
Mon Jan 11 21:10:07 UTC 2021
Hi! This PR addresses JMC-7063 [[0]](https://bugs.openjdk.java.net/browse/JMC-7063), in which there are test failures when running uitests on the threads page. This test failure has also been brought up in JMC-7077 [[1]](https://bugs.openjdk.java.net/browse/JMC-7077), which encompasses the larger problem of uitest failures in JMC 8.
The problem here was the hardcoded time strings (do'h!). I had originally thought the problem was Jemmy being unable to find the time filter text boxes due to screen size limitations, but in reality Jemmy couldn't find the text boxes because we had hardcoded the time strings in the test class for verification purposes. A big thanks to Bipin for posting a video clip of the test failure to the JMC-7077 [[1]](https://bugs.openjdk.java.net/browse/JMC-7077) issue report, I was able to see that Jemmy was struggling to find the text box with "08:06:19:489" because it was not the right time in his timezone!
To address this, Jemmy will now lookup the text boxes using a "name" that is assigned to them when they are created. The unit tests will now use a simple date formatter to apply a time offset to the start and end times to verify behaviour in the UI instead of checking against a (probably) incorrect hardcoded time string.
For quicker testing and reviewing, I've attached a patch diff (in txt format) that can be applied on top of this commit if you wish to only test the JfrThreadsPageTest. It simply prevents the non-flightrecorder.ui uitest modules from running, and gets rid of all other test classes: [only-jfrthreadspagetest.txt](https://github.com/openjdk/jmc/files/5797935/only-jfrthreadspagetest.txt)
[0] https://bugs.openjdk.java.net/browse/JMC-7063
[1] https://bugs.openjdk.java.net/browse/JMC-7077
-------------
Commit messages:
- 7063: JfrThreadsPageTest (UI-test) fails
Changes: https://git.openjdk.java.net/jmc/pull/195/files
Webrev: https://webrevs.openjdk.java.net/?repo=jmc&pr=195&range=00
Issue: https://bugs.openjdk.java.net/browse/JMC-7063
Stats: 57 lines in 2 files changed: 27 ins; 5 del; 25 mod
Patch: https://git.openjdk.java.net/jmc/pull/195.diff
Fetch: git fetch https://git.openjdk.java.net/jmc pull/195/head:pull/195
PR: https://git.openjdk.java.net/jmc/pull/195
More information about the jmc-dev
mailing list