mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-04 05:00:31 +00:00
Merge
This commit is contained in:
commit
19373b2ff0
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2022, 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
|
||||
@ -43,7 +43,7 @@ public class TestJVMCrash {
|
||||
public static void main(String... args) throws Exception {
|
||||
int id = 1;
|
||||
while (true) {
|
||||
try (TestProcess process = new TestProcess("crash-application-" + id++)) {
|
||||
try (TestProcess process = new TestProcess("crash-application-" + id++, false /* createCore */)) {
|
||||
AtomicInteger eventCounter = new AtomicInteger();
|
||||
try (EventStream es = EventStream.openRepository(process.getRepository())) {
|
||||
// Start from first event in repository
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2022, 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
|
||||
@ -54,11 +54,16 @@ public final class TestProcess implements AutoCloseable {
|
||||
private final Path path;
|
||||
|
||||
public TestProcess(String name) throws IOException {
|
||||
this(name, true /* createCore */);
|
||||
}
|
||||
|
||||
public TestProcess(String name, boolean createCore) throws IOException {
|
||||
this.path = Paths.get("action-" + System.currentTimeMillis()).toAbsolutePath();
|
||||
String[] args = {
|
||||
"--add-exports",
|
||||
"java.base/jdk.internal.misc=ALL-UNNAMED",
|
||||
"-XX:StartFlightRecording:settings=none",
|
||||
"-XX:" + (createCore ? "+" : "-") + "CreateCoredumpOnCrash",
|
||||
TestProcess.class.getName(), path.toString()
|
||||
};
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user