Skip to content

Conversation

@nehajoshinj
Copy link

@nehajoshinj nehajoshinj commented Nov 20, 2025

In this PR we have updated the code to remove the duplicate call and ensure JVM flags are added only once.

ISSUE :-

In the test case --> ProcessTools.createTestJavaProcessBuilder(Utils.addTestJavaOpts("SSLEngineKeyLimit", "p", args[1], args[2]));

-> Before executing ProcessTools.createTestJavaProcessBuilder() we are calling ---> Utils.addTestJavaOpts() which internally call prependTestJavaOpts();

public static String[] addTestJavaOpts(String... userArgs) {
return prependTestJavaOpts(userArgs);
}

-> Then again inside ProcessTools.createTestJavaProcessBuilder() method we are calling Utils.prependTestJavaOpts()

public static ProcessBuilder createTestJavaProcessBuilder(String... command) {
return createJavaProcessBuilder(Utils.prependTestJavaOpts(command));
}

Calling Utils.prependTestJavaOpts() twice leads to duplicate JVM flags (This method call-> getTestJavaOpts() the main reason for duplication and below is the implementation for the same. )

public static String[] getTestJavaOpts() {
List opts = new ArrayList();
Collections.addAll(opts, safeSplitString(VM_OPTIONS));
Collections.addAll(opts, safeSplitString(JAVA_OPTIONS));
return opts.toArray(new String[0]);
}

Contributed-by: @Korov
#26404

https://bugs.openjdk.org/browse/JDK-8362658


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8362658: sun/security/ssl/SSLEngineImpl/* tests duplicate jvm flags (Bug - P4)

Reviewers

Contributors

  • Lei Zhu <korov9.c@gmail.com>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28428/head:pull/28428
$ git checkout pull/28428

Update a local copy of the PR:
$ git checkout pull/28428
$ git pull https://git.openjdk.org/jdk.git pull/28428/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28428

View PR using the GUI difftool:
$ git pr show -t 28428

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28428.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 20, 2025

👋 Welcome back nehajoshinj! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 20, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title JDK-8362658: sun/security/ssl/SSLEngineImpl/* tests duplicate jvm flags 8362658: sun/security/ssl/SSLEngineImpl/* tests duplicate jvm flags Nov 20, 2025
@openjdk openjdk bot added the security security-dev@openjdk.org label Nov 20, 2025
@openjdk
Copy link

openjdk bot commented Nov 20, 2025

@nehajoshinj The following label will be automatically applied to this pull request:

  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@nehajoshinj nehajoshinj changed the title 8362658: sun/security/ssl/SSLEngineImpl/* tests duplicate jvm flags JDK-8362658: sun/security/ssl/SSLEngineImpl/* tests duplicate jvm flags Nov 20, 2025
@nehajoshinj nehajoshinj changed the title JDK-8362658: sun/security/ssl/SSLEngineImpl/* tests duplicate jvm flags 8362658: sun/security/ssl/SSLEngineImpl/* tests duplicate jvm flags Nov 20, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 20, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 20, 2025

Webrevs

Utils.addTestJavaOpts("SSLEngineKeyLimit", "p", args[1],
args[2]));

ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("SSLEngineKeyLimit", "p", args[1], args[2]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good to me, but try not to overstep the 80 character line-width

Copy link
Author

Choose a reason for hiding this comment

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

I have updated the code .

@rhalade
Copy link
Member

rhalade commented Nov 21, 2025

LGTM. Also include an update to remove tests from ProblemList at https://github.com/openjdk/jdk/blob/master/test/jdk/ProblemList-jvmti-stress-agent.txt#L31

@nehajoshinj
Copy link
Author

/contributor add @Korov

@openjdk
Copy link

openjdk bot commented Nov 21, 2025

@nehajoshinj @Korov was not found in the census.

Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@nehajoshinj
Copy link
Author

/contributor add Lei Zhu korov9.c@gmail.com

@openjdk
Copy link

openjdk bot commented Nov 21, 2025

@nehajoshinj
Contributor Lei Zhu <korov9.c@gmail.com> successfully added.

Copy link
Member

@myankelev myankelev left a comment

Choose a reason for hiding this comment

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

Looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfr Pull request is ready for review security security-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

4 participants