8314840: 3 gc/epsilon tests ignore external vm options

Reviewed-by: tschatzl
This commit is contained in:
Ramkumar Sunderbabu 2025-02-27 12:58:35 +00:00 committed by SendaoYan
parent 63e0fc4331
commit 799ac5288e
3 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2017, 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,13 +37,13 @@ import jdk.test.lib.process.ProcessTools;
public class TestDieDefault {
public static void passWith(String... args) throws Exception {
OutputAnalyzer out = ProcessTools.executeLimitedTestJava(args);
OutputAnalyzer out = ProcessTools.executeTestJava(args);
out.shouldNotContain("OutOfMemoryError");
out.shouldHaveExitValue(0);
}
public static void failWith(String... args) throws Exception {
OutputAnalyzer out = ProcessTools.executeLimitedTestJava(args);
OutputAnalyzer out = ProcessTools.executeTestJava(args);
out.shouldContain("OutOfMemoryError");
if (out.getExitValue() == 0) {
throw new IllegalStateException("Should have failed with non-zero exit code");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2017, 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,13 +38,13 @@ import jdk.test.lib.process.ProcessTools;
public class TestDieWithHeapDump {
public static void passWith(String... args) throws Exception {
OutputAnalyzer out = ProcessTools.executeLimitedTestJava(args);
OutputAnalyzer out = ProcessTools.executeTestJava(args);
out.shouldNotContain("OutOfMemoryError");
out.shouldHaveExitValue(0);
}
public static void failWith(String... args) throws Exception {
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args);
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(args);
Process p = pb.start();
OutputAnalyzer out = new OutputAnalyzer(p);
out.shouldContain("OutOfMemoryError");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2017, 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -39,14 +39,14 @@ public class TestDieWithOnError {
static String ON_ERR_MSG = "Epsilon error handler message";
public static void passWith(String... args) throws Exception {
OutputAnalyzer out = ProcessTools.executeLimitedTestJava(args);
OutputAnalyzer out = ProcessTools.executeTestJava(args);
out.shouldNotContain("OutOfMemoryError");
out.stdoutShouldNotMatch("^" + ON_ERR_MSG);
out.shouldHaveExitValue(0);
}
public static void failWith(String... args) throws Exception {
OutputAnalyzer out = ProcessTools.executeLimitedTestJava(args);
OutputAnalyzer out = ProcessTools.executeTestJava(args);
out.shouldContain("OutOfMemoryError");
if (out.getExitValue() == 0) {
throw new IllegalStateException("Should have failed with non-zero exit code");