RFR: 7903746: jtreg tests run extremely slow on some environments due to hostname lookups [v3]
Mark Sheppard
msheppar at openjdk.org
Tue Jul 9 10:02:44 UTC 2024
On Tue, 9 Jul 2024 08:09:13 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> Can I please get a review of this change which proposes to address https://bugs.openjdk.org/browse/CODETOOLS-7903746?
>>
>> As noted in that issue, jtreg determines the hotsname and populates that detail in the `TestResult`. Right now, it does it for every single test that's part of that test run. The hostname determination is expensive and on some system can be slow due to hostname resolutions. It's not necessary to do this lookup for every test and can be done just once for that test run. The commit in this PR does just that by looking it up once for that run and then making it available in the `TestResult` of each of the tests.
>>
>> I have run this change against our JDK mainline in the CI for tier1 through tier6. This hasn't shown any regressions and I have manually verified that the hostname is correctly made available, like before, in the .jtr files of these tests.
>
> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>
> Mark's suggestion - "Cached" instead of "Lazy"
src/share/classes/com/sun/javatest/regtest/config/RegressionEnvironment.java line 69:
> 67: hostname = InetAddress.getLocalHost().getCanonicalHostName();
> 68: } catch (UnknownHostException e) {
> 69: hostname = "127.0.0.1";
I'm not sure "127.0.0.1" is a canonical hostname ;-)
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/204#discussion_r1670179533
More information about the jtreg-dev
mailing list