Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8266184: a few compiler/debug tests don't check exit code #3748

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
@@ -26,7 +26,6 @@
import java.nio.file.Paths;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.Asserts;

/*
* @test
@@ -58,7 +57,8 @@ public static void main(String[] args) throws Exception {
"-Xcomp", "-XX:-TieredCompilation", "-XX:+UnlockDiagnosticVMOptions",
"-XX:CompileOnly=" + className + "::sum", "-XX:+" + stressOpt,
"-XX:+LogCompilation", "-XX:LogFile=" + log, className, "10"};
ProcessTools.createJavaProcessBuilder(procArgs).start().waitFor();
new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(procArgs).start())
.shouldHaveExitValue(0);
new OutputAnalyzer(Paths.get(log))
.shouldContain("stress_test seed");
} else {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. 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
@@ -49,6 +49,7 @@ static String cmTrace(String stressOpt, int stressSeed) throws Exception {
"-XX:StressSeed=" + stressSeed, className, "10"};
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
OutputAnalyzer out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
// Extract the trace of our method (the last one after those of all
// mandatory stubs such as _new_instance_Java, etc.).
String [] traces = out.getStdout().split("\\R");
@@ -49,11 +49,12 @@ static String phaseTrace(String stressOption, String traceOption,
className, "10"};
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
OutputAnalyzer out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
return out.getStdout();
}

static String igvnTrace(int stressSeed) throws Exception {
return phaseTrace("StressIGVN", "TraceIterativeIGVN", stressSeed);
return phaseTrace("StressIGVN", "TraceIterativeGVN", stressSeed);
}

static String ccpTrace(int stressSeed) throws Exception {