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

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

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

@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.

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

Development

Successfully merging this pull request may close these issues.

2 participants