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

7903373: Add ability to customize test execution using main wrapper plugin #136

Closed
wants to merge 61 commits into from

Conversation

lmesnik
Copy link
Member

@lmesnik lmesnik commented Oct 21, 2022

The fix adds support of a plugin that customizes test execution.


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-7903373: Add ability to customize test execution using main wrapper plugin

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 136

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

Using diff file

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

@@ -171,6 +171,12 @@ help.main.ignore.error.desc=(Default.) Execute the actions up to the @ignore tag
then give an "Error" result.
help.main.ignore.run.desc=Run the test, as though the @ignore tag were not present.
help.main.l.desc=List the tests that would be executed instead of executing them.
help.main.ttf.arg=<classname>
help.main.ttf.desc=Specifies the class to create thread factory for test execution. \
The class should implement a j.u.c.TestFactory interface.
Copy link
Collaborator

Choose a reason for hiding this comment

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

change "a" to "the" and spell out j.u.c in full

@openjdk
Copy link

openjdk bot commented Feb 16, 2023

@lmesnik this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout loom
git fetch https://git.openjdk.org/jtreg master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Feb 16, 2023
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Feb 16, 2023
Comment on lines 56 to 68
static ThreadFactory loadThreadFactory(String className, String path) {
ClassLoader loader = ClassLoader.getSystemClassLoader();
if (path != null) {
SearchPath classpath = new SearchPath(path);
List<URL> urls = new ArrayList<>();
for (Path f : classpath.asList()) {
try {
urls.add(f.toUri().toURL());
} catch (MalformedURLException e) {
}
}
loader = new URLClassLoader(urls.toArray(new URL[urls.size()]), loader);
}
Copy link
Collaborator

@jonathan-gibbons jonathan-gibbons Feb 24, 2023

Choose a reason for hiding this comment

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

In the othervm case, this code will presumably just be called once, but in the agentvm case, won't it be called once per test, and since the class loader is never closed, (see URLCLassLoader.close) won't that lead to a leak of any resources that might be involved ... especially any zip/jar files that might be opened?

Is it not worth trying to cache and reuse the loader?

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 have updated the code to close the classloader. The jtreg doesn't have now any embedded implementations so path never could be null, I suppose.

@openjdk
Copy link

openjdk bot commented Mar 4, 2023

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

7903373: Add ability to customize test execution using main wrapper plugin

Reviewed-by: jjg

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 (@jonathan-gibbons) 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 ready Pull request is ready to be integrated label Mar 4, 2023
@lmesnik
Copy link
Member Author

lmesnik commented Mar 4, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Mar 4, 2023
@openjdk
Copy link

openjdk bot commented Mar 4, 2023

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

@jonathan-gibbons
Copy link
Collaborator

/sponsor

@openjdk
Copy link

openjdk bot commented Mar 4, 2023

Going to push as commit 5b9e661.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 4, 2023
@openjdk openjdk bot closed this Mar 4, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Mar 4, 2023
@openjdk
Copy link

openjdk bot commented Mar 4, 2023

@jonathan-gibbons @lmesnik Pushed as commit 5b9e661.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants