diff --git a/test/hotspot/jtreg/gc/z/TestUncommit.java b/test/hotspot/jtreg/gc/z/TestUncommit.java index 0ba4c55f22ad2..afb736501dd6b 100644 --- a/test/hotspot/jtreg/gc/z/TestUncommit.java +++ b/test/hotspot/jtreg/gc/z/TestUncommit.java @@ -108,7 +108,16 @@ private static void test(int objectSize) throws Exception { throw new Exception("Uncommitted too fast"); } + // In typical conditions (system not over-provisioned or slow), + // uncommitting is expected to complete within 3 * ZUncommitDelay after + // the last commit. To accommodate less ideal environments, only + // durations exceeding 5 * ZUncommitDelay are flagged as errors. + if (actualDelay > delay * 3) { + log(" *** Uncommit slower than expected. ***"); + } + + if (actualDelay > delay * 5) { throw new Exception("Uncommitted too slow"); }