Skip to content

Conversation

@sendaoYan
Copy link
Member

@sendaoYan sendaoYan commented Sep 24, 2025

Hi all,

In jtreg.sh it will combine all the java options and jtreg options in the for i in "$@" loop. SHELL use javaOpts and jtregOpts as global varable by default, this means jtreg.sh will receive the value of javaOpts and jtregOpts outside. I think this unexpected.
To avoid this siutation, I think we should unset javaOpts and jtregOpts before use it.


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

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 291

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jtreg/pull/291.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 24, 2025

👋 Welcome back syan! 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 Sep 24, 2025

@sendaoYan This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

7904084: Unset javaOpts and jtregOpts in jtreg.sh

Reviewed-by: cstein, liach

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 2 new commits pushed to the master branch:

  • 1eed650: 7904144: Update version to 8.3
  • 5afa26a: 7904143: Release jtreg 8.2.1

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@sormuras) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 24, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 24, 2025

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 23, 2025

@sendaoYan This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@sendaoYan
Copy link
Member Author

/touch

@openjdk
Copy link

openjdk bot commented Oct 23, 2025

@sendaoYan The pull request is being re-evaluated and the inactivity timeout has been reset.

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 20, 2025

@sendaoYan This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@sormuras
Copy link
Member

sormuras commented Dec 2, 2025

Did you see an error when used in combination with another or the same script? If yes, which one(s)?

There's related prior-art in the script for the DUALCASE variable. Which is declard and initialized before each use, and unset after each use. Would it be possible to the same for javaOpts and jtregOpts? Or at least unset both after use.

Another solution would be to introduce script-local variables, right?

@sendaoYan
Copy link
Member Author

sendaoYan commented Dec 2, 2025

Did you see an error when used in combination with another or the same script? If yes, which one(s)?

Below command shows this error:

> jtreg -version
jtreg 8.1-dev+0
Installed in /home/yansendao/JDK/tools/jtreg/jtreg-8.1/lib/jtreg.jar
Running on platform version 25.0.1-internal from /home/yansendao/JDK/binary/openjdk/jdk25u.
Built with Java(TM) 2 SDK, Version 25.0.1-internal-987af5af on October 10, 2025.
JT Harness, version 6.0 ea b24 (October 10, 2025)
Java Assembler Tools, version 8.1 ea 01 (October 10, 2025)
TestNG: testng-7.3.0.jar, guice-5.1.0.jar, jcommander-1.82.jar
JUnit: junit-platform-console-standalone-1.13.4.jar

> jtregOpts="ValuesBeforeStartJtreg" jtreg -version
Error: Cannot find file: ValuesBeforeStartJtreg

There's related prior-art in the script for the DUALCASE variable. Which is declard and initialized before each use, and unset after each use. Would it be possible to the same for javaOpts and jtregOpts? Or at least unset both after use.

I think unset javaOpts is identical to javaOpts=""
unset the shell variable before shell script exit seems meaningless in my opinion.

Another solution would be to introduce script-local variables, right?

local illegal outside shell function.

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 30, 2025

@sendaoYan This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 28, 2026

@sendaoYan This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 28, 2026
@sendaoYan
Copy link
Member Author

Thanks for the reviews @sormuras

Does this PR need second reviewer, or may I integrate this PR now.

Copy link
Member

@liach liach left a comment

Choose a reason for hiding this comment

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

Clearing variable before loop makes sense.

@sormuras
Copy link
Member

[...] may I integrate this PR now.

Yes. Happy to sponsor afterwards.

@sendaoYan
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 29, 2026
@openjdk
Copy link

openjdk bot commented Jan 29, 2026

@sendaoYan
Your change (at version a3076f5) is now ready to be sponsored by a Committer.

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

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored

Development

Successfully merging this pull request may close these issues.

3 participants