RFR: JDK-8314426: runtime/os/TestTrimNative.java is failing on slow machines

Aleksey Shipilev shade at openjdk.org
Tue Aug 22 13:28:31 UTC 2023


On Wed, 16 Aug 2023 14:28:38 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> SAP reported errors on slow machines. Patch hardens the test against that.
> 
> - remove the grep for "Native Trimmer Stop" message, since that message is raced by the VM death and may not appear on slow machines
> - for the low-interval test, made the number of trims to happen dependent on the runtime of the test. On slow machines, we could run longer than 3 seconds and therefore see more trim messages

Looks fine, minor nits.

test/hotspot/jtreg/runtime/os/TestTrimNative.java line 305:

> 303:                 long ms2 = System.currentTimeMillis();
> 304:                 long runtime_ms = ms2 - ms1;
> 305:                 long maxTrimsExpected = runtime_ms;

Fixes the style and improves code a bit:

Suggestion:

                int maxTrimsExpected = (int)(ms2 - ms1); // 1ms trim interval


Then `(int)maxTrimsExpected` does not need a cast too.

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

Marked as reviewed by shade (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15309#pullrequestreview-1589439817
PR Review Comment: https://git.openjdk.org/jdk/pull/15309#discussion_r1301644655


More information about the hotspot-runtime-dev mailing list