Skip to content

Commit

Permalink
8316451: 6 java/lang/instrument/PremainClass tests ignore VM flags
Browse files Browse the repository at this point in the history
Reviewed-by: cjplummer, sspitsyn
  • Loading branch information
lmesnik committed Feb 15, 2024
1 parent 99c9ae1 commit 9029bf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions test/jdk/java/lang/instrument/NegativeAgentRunner.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024, 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
Expand Down Expand Up @@ -35,7 +35,7 @@ public static void main(String argv[]) throws Exception {
}
String agentClassName = argv[0];
String excepClassName = argv[1];
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
"-javaagent:" + agentClassName + ".jar", "-Xmx128m", "-XX:-CreateCoredumpOnCrash",
agentClassName);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
Expand Down
12 changes: 4 additions & 8 deletions test/jdk/java/lang/instrument/PremainClass/PremainClassTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, 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
Expand Down Expand Up @@ -39,14 +39,10 @@ public class PremainClassTest {
// a non ascii character.
// Verify that the premain() function is executed correctly.
public static void main(String[] a) throws Exception {
String testArgs = String.format(
"-javaagent:%s/Agent.jar -classpath %s DummyMain",
System.getProperty("test.src"),
System.getProperty("test.classes", "."));
String testArgs = String.format("-javaagent:%s/Agent.jar",
System.getProperty("test.src"));

ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
Utils.addTestJavaOpts(testArgs.split("\\s+")));
System.out.println("testjvm.cmd:" + Utils.getCommandLine(pb));
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(testArgs, "DummyMain");

OutputAnalyzer output = ProcessTools.executeProcess(pb);
System.out.println("testjvm.stdout:" + output.getStdout());
Expand Down

3 comments on commit 9029bf6

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 9029bf6 Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 9029bf6 Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-9029bf64 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 9029bf64 from the openjdk/jdk repository.

The commit being backported was authored by Leonid Mesnik on 15 Feb 2024 and was reviewed by Chris Plummer and Serguei Spitsyn.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-9029bf64:backport-GoeLin-9029bf64
$ git checkout backport-GoeLin-9029bf64
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-9029bf64

Please sign in to comment.