Skip to content

Commit

Permalink
[QuickStart] Fix QuickStart test failures
Browse files Browse the repository at this point in the history
Summary: Fix test failures

Test Plan: all quickstart tests

Reviewers: lei.yul, sanhong.lsh
  • Loading branch information
jia-wei-tang committed Jul 12, 2023
1 parent 721ab94 commit e0d65a1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @summary Test the flow to determine tracer or replayer
* @library /test/lib
* @requires os.arch=="amd64"
* @run main/othervm TestDeterminingTracerOrReplayer
* @run main/othervm/timeout=600 TestDeterminingTracerOrReplayer
*/

import jdk.test.lib.process.OutputAnalyzer;
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/com/alibaba/quickstart/TestIntegrityCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @summary Test Integrity Check
* @library /test/lib
* @requires os.arch=="amd64"
* @run main/othervm TestIntegrityCheck
* @run main/othervm/timeout=600 TestIntegrityCheck
*/

import jdk.test.lib.process.OutputAnalyzer;
Expand Down Expand Up @@ -37,7 +37,7 @@ void verifyOptionChange() throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xquickstart:path=" + cachepath, "-Xquickstart:verbose,containerImageEnv=pouchid", "-esa", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
System.out.println(output.getOutput());
output.shouldContain("JVM option isn't the same");
output.shouldContain("JVM option count isn't the same");
output.shouldHaveExitValue(0);
}

Expand Down
4 changes: 2 additions & 2 deletions test/jdk/com/alibaba/quickstart/TestNotifyDump.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @build TestDump
* @requires os.arch=="amd64"
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar test.jar TestDump TestDump$Policy TestDump$ClassLoadingPolicy TestDump$WatcherThread
* @run main/othervm TestNotifyDump
* @run main/othervm/timeout=600 TestNotifyDump
*/

import jdk.test.lib.process.OutputAnalyzer;
Expand All @@ -18,7 +18,7 @@

public class TestNotifyDump {

private static final String TESTJAR = "./test.jar";
private static final String TESTJAR = "./test-notifyDump.jar";
private static final String TESTCLASS = "TestDump";

public static void main(String[] args) throws Exception {
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/com/alibaba/quickstart/TestNotifyDumpByAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @build TestDump
* @requires os.arch=="amd64"
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar test.jar TestDump TestDump$Policy TestDump$ClassLoadingPolicy TestDump$WatcherThread
* @run main/othervm TestNotifyDumpByAPI
* @run main/othervm/timeout=600 TestNotifyDumpByAPI
*/

import jdk.test.lib.process.OutputAnalyzer;
Expand All @@ -18,7 +18,7 @@

public class TestNotifyDumpByAPI {

private static final String TESTJAR = "./test.jar";
private static final String TESTJAR = "./test-notifyDumpByAPI.jar";
private static final String TESTCLASS = "TestDump";

public static void main(String[] args) throws Exception {
Expand Down
15 changes: 13 additions & 2 deletions test/jdk/com/alibaba/quickstart/TestNotifyDumpByJcmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @build TestDump
* @requires os.arch=="amd64"
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar test.jar TestDump TestDump$Policy TestDump$ClassLoadingPolicy TestDump$WatcherThread
* @run main/othervm TestNotifyDumpByJcmd
* @run main/othervm/timeout=600 TestNotifyDumpByJcmd
*/

import jdk.test.lib.process.OutputAnalyzer;
Expand All @@ -18,11 +18,12 @@

public class TestNotifyDumpByJcmd {

private static final String TESTJAR = "./test.jar";
private static final String TESTJAR = "./test-notifyDumpByJcmd.jar";
private static final String TESTCLASS = "TestDump";

public static void main(String[] args) throws Exception {
String dir = AccessController.doPrivileged(new GetPropertyAction("test.classes"));
destroyCache(dir);
TestNotifyDumpByJcmd.verifyPathSetting(dir);
new File(dir).delete();
}
Expand All @@ -45,4 +46,14 @@ static void verifyPathSetting(String parentDir) throws Exception {
output.shouldHaveExitValue(0);
}

static void destroyCache(String parentDir) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-Xquickstart:destroy",
"-Xquickstart:path=" + parentDir + "/quickstartcache",
"-Xquickstart:verbose", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("destroy the cache folder");
output.shouldHaveExitValue(0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @library /test/lib
* @library /lib/testlibrary
* @requires os.arch=="amd64"
* @run main/othervm TestParallelProcessRun
* @run main/othervm/timeout=600 TestParallelProcessRun
*/

import jdk.test.lib.process.OutputAnalyzer;
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/com/alibaba/quickstart/TestPrintStat.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @summary Test -Xquickstart:printStat option
* @library /test/lib
* @requires os.arch=="amd64"
* @run main/othervm TestPrintStat
* @run main/othervm/timeout=600 TestPrintStat
*/

import jdk.test.lib.process.OutputAnalyzer;
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/com/alibaba/quickstart/TestQuickStartOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @summary Test -Xquickstart options
* @library /test/lib
* @requires os.arch=="amd64"
* @run main/othervm TestQuickStartOptions
* @run main/othervm/timeout=600 TestQuickStartOptions
*/

import jdk.test.lib.process.OutputAnalyzer;
Expand Down

0 comments on commit e0d65a1

Please sign in to comment.