Skip to content

Commit

Permalink
[Misc] Take VMoptions set in jtreg to LingeredApp
Browse files Browse the repository at this point in the history
Summary: LingeredApp is started without jtreg's vm options. It will lead
to testing error due to inconsistent vm options for dumping cds and
applying cds.
Testing: jtreg
Reviewers: raodao, lvfei
Issue: #904
  • Loading branch information
ziyilin committed Dec 25, 2024
1 parent 19c8d00 commit c04f08e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/lib/jdk/test/lib/apps/LingeredApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -334,6 +335,8 @@ public List<String> runAppPrepare(List<String> vmArguments) {
// Lets user manage LingeredApp options
cmd.addAll(vmArguments);
}
Collections.addAll(cmd, Utils.getTestJavaOpts());

if (forceCrash) {
cmd.add("-XX:+CreateCoredumpOnCrash");
// We need to find libLingeredApp.so for the crash() native method
Expand Down Expand Up @@ -377,7 +380,6 @@ public void runApp(List<String> vmArguments)
if (forceCrash) {
cmd.add("forceCrash"); // Let the subprocess know to force a crash
}

printCommandLine(cmd);

ProcessBuilder pb = new ProcessBuilder(cmd);
Expand Down

0 comments on commit c04f08e

Please sign in to comment.