Skip to content

Commit

Permalink
8333200: Test containers/docker/TestPids.java fails Limit value -1 is…
Browse files Browse the repository at this point in the history
… not accepted as unlimited

Signed-off-by: sendaoYan <yansendao.ysd@alibaba-inc.com>
  • Loading branch information
sendaoYan committed May 29, 2024
1 parent bc7d9e3 commit 0785620
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/hotspot/jtreg/containers/docker/TestPids.java
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -113,12 +113,13 @@ private static void checkResult(List<String> 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);
Expand Down

0 comments on commit 0785620

Please sign in to comment.