From 4832f5da6826028b6935856291f8097df20fd5d7 Mon Sep 17 00:00:00 2001 From: duke Date: Tue, 23 Sep 2025 00:28:06 +0000 Subject: [PATCH] Backport 7ab74c5f268dac82bbd36355acf8e4f3d357134c --- test/hotspot/jtreg/containers/docker/TestPids.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/containers/docker/TestPids.java b/test/hotspot/jtreg/containers/docker/TestPids.java index f6c89c5c63a..bab07eb98c3 100644 --- a/test/hotspot/jtreg/containers/docker/TestPids.java +++ b/test/hotspot/jtreg/containers/docker/TestPids.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -113,12 +113,13 @@ private static void checkResult(List lines, String lineMarker, String ex Asserts.assertEquals(parts.length, 2); String actual = parts[1].replaceAll("\\s",""); - // Unlimited pids leads on some setups not to "max" in the output, but to a high number if (expectedValue.equals("max")) { - if (actual.equals("max")) { - System.out.println("Found expected max for unlimited pids value."); + // Unlimited pids accept max or -1 + if (actual.equals("max") || actual.equals("-1")) { + System.out.println("Found expected " + actual + " for unlimited pids value."); } else { try { + // Unlimited pids leads on some setups not to "max" in the output, but to a high number int ai = Integer.parseInt(actual); if (ai > 20000) { System.out.println("Limit value " + ai + " got accepted as unlimited, log line was " + line);