Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7903931: Add "test.thread.factory" property to filter tests based on test thread factory value #242

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lmesnik
Copy link
Member

@lmesnik lmesnik commented Jan 14, 2025

jtreg support test thread factory parameter that allows to execute tests by running main in virtual thread.

Currently, all incompatible tests are problemlisted. However after security manager removal the number of such tests is small.

So is it makes sense to add "jtreg.ttf" property to filter tests based on test thread factory value to allow filter out incompatible tests.

The only jtreg knows if -testThreadFactory is set so it should set corresponding property


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

  • CODETOOLS-7903931: Add "test.thread.factory" property to filter tests based on test thread factory value (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 242

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 14, 2025

👋 Welcome back lmesnik! 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 Jan 14, 2025

@lmesnik 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:

7903931: Add "test.thread.factory" property to filter tests based on test thread factory value

Reviewed-by: cstein, iris

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 4 new commits pushed to the master branch:

  • 081b8f7: 7903920: Support building jtreg on FreeBSD
  • 7dcd0bc: 7903940: Remove problematic LIBRARY.properties implementation
  • 4544d5f: 7903936: Update variable names in build.sh documentation
  • b443973: 7903930: Support running individual parameterized tests and @nested test classes

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, @irisclark) 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 Jan 14, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 14, 2025

Webrevs

@sormuras
Copy link
Member

The namespace jtreg. is not used in RegressionContext yet, but it makes sense to introduce it here.

Is ttf a good abbreviation for test thread factory though? Would jtreg.testThreadFactory be too long in filter expressions?

@lmesnik
Copy link
Member Author

lmesnik commented Jan 27, 2025

The namespace jtreg. is not used in RegressionContext yet, but it makes sense to introduce it here.

Is ttf a good abbreviation for test thread factory though? Would jtreg.testThreadFactory be too long in filter expressions?

I think jtreg.ttf is good enough, but might be becasue I know the context. If you feel that for all jtreg users jtreg.testThreadFactory, I am fine with this.

@jonathan-gibbons
Copy link
Collaborator

jonathan-gibbons commented Jan 27, 2025

The namespace jtreg. is not used in RegressionContext yet, but it makes sense to introduce it here.
Is ttf a good abbreviation for test thread factory though? Would jtreg.testThreadFactory be too long in filter expressions?

I think jtreg.ttf is good enough, but might be becasue I know the context. If you feel that for all jtreg users jtreg.testThreadFactory, I am fine with this.

For the long term, clarity is better than cryptic brevity.

@sormuras
Copy link
Member

What about re-using the test. namespace used by jtreg for system properties? Meaning, we'd call this property introduced here:

  • test.threadFactory

@lmesnik
Copy link
Member Author

lmesnik commented Jan 28, 2025

I'm fine with using test namespace.
Might be

  • test.thread.factory
    then?

It is the name of property used by test to check thread factory inside of test.
Leonid

@sormuras
Copy link
Member

sormuras commented Jan 28, 2025

We have a winner! test.thread.factory

@lmesnik lmesnik changed the title 7903931: Add "jtreg.ttf" property to filter tests based on test thread factory value 7903931: Add "test.thread.factory" property to filter tests based on test thread factory value Jan 28, 2025
@@ -101,6 +101,11 @@ static RegressionContext getDefault() {
values.put("os.maxMemory", String.valueOf(os.maxMemory));
values.put("os.maxSwap", String.valueOf(os.maxSwap));

String testThreadFactory = (params == null || params.getTestThreadFactory() == null)
? "null"
Copy link
Member

Choose a reason for hiding this comment

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

Having null as the value for "no test thread factory available" is right choice regarding easier handling on the use-site?

Or would skipping the values.put() call be a better default? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't checked but it should be considered as a "invalid name" if we don't put any value.
Also, want to be consistent with other properties, that just have some default value, often "null".

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 31, 2025
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
Development

Successfully merging this pull request may close these issues.

4 participants