Skip to content

Conversation

@calvinccheung
Copy link
Member

@calvinccheung calvinccheung commented Apr 19, 2023

To avoid duplicate class name MyShutdown, the fix is to change the MyShutdown class name for the LambdaProxyDuringShutdown.java test to ShutdownHelper.

Tested manually by running the LInkClassTest.java and LambdaProxyDuringShutdown.java tests serially on linux-x64.
Also ran tiers 1 and 3 testing.


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-8304696: Duplicate class names in dynamicArchive tests can lead to test failure

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13542

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

Using diff file

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

Webrev

Link to Webrev Comment

@calvinccheung
Copy link
Member Author

/label add hotspot-runtime

@calvinccheung calvinccheung marked this pull request as ready for review April 19, 2023 17:07
@bridgekeeper
Copy link

bridgekeeper bot commented Apr 19, 2023

👋 Welcome back ccheung! 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 openjdk bot added rfr Pull request is ready for review hotspot-runtime hotspot-runtime-dev@openjdk.org labels Apr 19, 2023
@openjdk
Copy link

openjdk bot commented Apr 19, 2023

@calvinccheung
The hotspot-runtime label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Apr 19, 2023

Webrevs

@iklam
Copy link
Member

iklam commented Apr 20, 2023

I think it's better to restructure the test classes to avoid having the same problem in the future -- classes with generic names that appear in multiple, unrelated test cases.

In this particular case, we have both LinkClassApp.java and LambdaProxyDuringShutdownApp.java that contain two different implementation of a class with the same name, MyShutdown.

I would suggest putting the small, generic classes as static inner classes. E.g.,

public class LinkClassApp.java {
    static class MyShutdown { ... }
    static class Outer { ...}
}

Then, the test cases can refer to this class using a unique name, like

@run driver jdk.test.lib.helpers.ClassFileInstaller -jar lambda_proxy_shutdown.jar ....
             LambdaProxyDuringShutdownApp$MyShutdown ....

LinkClassApp.java (and perhaps some more test classes) should also be restructured similarly.

Thanks

@calvinccheung
Copy link
Member Author

I've made changes to the LinkClassTest.java and LinkClassApp.java as you suggested.
However, I can't make similar changes to the LambdaProxyDuringShutdownApp.java because it will not work with the original intention of the test. In particular:

                // Only the nest host (Outer) and the Inner class are loaded
                // from the dynamic archive.
                // The lambda proxy is not loaded from the dynamic archive.

So I reverted the changes to my original webrev.

Copy link
Member

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

@openjdk
Copy link

openjdk bot commented Apr 21, 2023

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

8304696: Duplicate class names in dynamicArchive tests can lead to test failure

Reviewed-by: iklam

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

  • 723037a: 8298048: Combine CDS archive heap into a single block
  • d518dbf: 8306440: Rename PSS:_num_optional_regions to _max_num_optional_regions
  • 9cd5741: 8306436: Rename PSS*:_n_workers to PSS*:_num_workers
  • 6e77e14: 8306456: Don't leak _worklist's memory in PhaseLive::compute
  • be6031b: 8303703: Add support of execution tests using virtual thread factory jtreg plugin
  • 5a00617: 8306543: GHA: MSVC installation is failing
  • 3da987a: 8306075: Micro-optimize Enum.hashCode
  • fdaabd6: 8306581: JVMCI tests failed when run with -XX:TypeProfileLevel=222 after JDK-8303431
  • 36ec05d: 8306430: Open source some AWT tests related to TextComponent and Toolkit
  • 8346ae2: 8305942: Open source several AWT Focus related tests
  • ... and 47 more: https://git.openjdk.org/jdk/compare/1b5d35ad2c8f0f3a43caba9d7a6d8e74f66caf5f...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 21, 2023
@calvinccheung
Copy link
Member Author

Thanks @iklam for the review.
/integrate

@openjdk
Copy link

openjdk bot commented Apr 21, 2023

Going to push as commit b2240bf.
Since your change was applied there have been 59 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 21, 2023

@calvinccheung Pushed as commit b2240bf.

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

@calvinccheung calvinccheung deleted the 8304696-duplicate-MyShutdown-dynamicArchive-tests branch April 21, 2023 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants