Skip to content

8372857: Improve debuggability of java/rmi/server/RemoteServer/AddrInUse.java test#28595

Closed
jaikiran wants to merge 3 commits intoopenjdk:masterfrom
jaikiran:8372857
Closed

8372857: Improve debuggability of java/rmi/server/RemoteServer/AddrInUse.java test#28595
jaikiran wants to merge 3 commits intoopenjdk:masterfrom
jaikiran:8372857

Conversation

@jaikiran
Copy link
Member

@jaikiran jaikiran commented Dec 2, 2025

Can I please get a review of this test-only change which improves the debuggability of the java/rmi/server/RemoteServer/AddrInUse.java test?

As noted in https://bugs.openjdk.org/browse/JDK-8213699, this test fails intermittently. The test code launches a Thread which does a LocateRegistry.createRegistry(port). The test then expects that call to return within (an arbitrary) 10 seconds and if it doesn't, then it considers that the test has ended up reproducing a bug which would cause a hang in the implementation of LocateRegistry.createRegistry(...) method.

The 10 seconds is a reasonable timeout, I think even for busy hosts. But we have seen this test fail because the launched thread which does the LocateRegistry.createRegistry(...) has either not started or completed within that period.

The changes in this PR updates that test code to remove the arbitrary 10 second timeout and instead just wait for the launched thread to complete. If the test doesn't complete within the configured jtreg test timeout (which by default is 2 minutes), then the jtreg and its failure handler infrastructure will gather the necessary thread dump and other states to help debug why the test timed out. This should help understand such intermittent failures in future (if it continues to fail).

I have triggered a tier testing of this change in our CI and will run a test repeat too.


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-8372857: Improve debuggability of java/rmi/server/RemoteServer/AddrInUse.java test (Sub-task - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28595

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 2, 2025

👋 Welcome back jpai! 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 Dec 2, 2025

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

8372857: Improve debuggability of java/rmi/server/RemoteServer/AddrInUse.java test

Reviewed-by: msheppar, smarks, syan

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 65 new commits pushed to 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.

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

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Dec 2, 2025
@openjdk
Copy link

openjdk bot commented Dec 2, 2025

@jaikiran The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

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

mlbridge bot commented Dec 2, 2025

Webrevs

Copy link

@msheppar msheppar left a comment

Choose a reason for hiding this comment

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

looks like a good cleanup of the test, adding the try with resources and the thread join is good job
LGTM

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 2, 2025
@stuart-marks
Copy link
Member

Overall, good cleanup.

A couple bits of history. The RMI tests are replete with these kind of ad-hoc timeouts. We've gotten rid of a lot of them over the years, but some of these are still lurking around, such as in this test. It's good to continue to remove them. One of the reasons this sort of stuff was probably added to individual tests was to facilitate running the tests standalone, that is, outsid the jtreg environment. Thus many tests didn't rely on jtreg to handle timeouts. I think we've moved away from this a long time ago. The priority needs to be reliability of tests run in CI systems, which happens many, many times every day. It's still possible, though somewhat inconvenient, to invoke a single test manually via jtreg, but I think this is the way it should be.

I'd suggest renaming the failure field and the local variable into which its value is loaded after the thread is joined. The difficulty with "failure" is that it's ambiguous whether it means the export has failed or that the test has failed. (It means the former.) The field is expected to contain an ExportException, so something that suggests that would be preferable.

@jaikiran
Copy link
Member Author

jaikiran commented Dec 3, 2025

Hello Stuart,

I'd suggest renaming the failure field and the local variable into which its value is loaded after the thread is joined. The difficulty with "failure" is that it's ambiguous whether it means the export has failed or that the test has failed. (It means the former.) The field is expected to contain an ExportException, so something that suggests that would be preferable.

That's a good point. I've updated the PR to rename it to registryExportFailure.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 3, 2025
@msheppar
Copy link

msheppar commented Dec 3, 2025

a minor point on the @bug additions. Typically, this is reserved for a bug id which is an actual fix to JDK source code. There is some ambiguity on this policy, but generally that has been the practice.

Maybe it is a topic which should be discussed at a jdk-dev level, and a clearer policy assertion established?

@jaikiran
Copy link
Member Author

jaikiran commented Dec 3, 2025

a minor point on the @bug additions. Typically, this is reserved for a bug id which is an actual fix to JDK source code. There is some ambiguity on this policy, but generally that has been the practice.

Thank you for reminding me about that, Mark. The OpenJDK dev guide has clear guidance on what the @bug tag should contain https://openjdk.org/guide/#jtreg :

You can add several bug ids in the same @bug tag, separated by a single space. These bug ids refer to product bugs for which a fix is verified by this test. JBS issues that track changes to the test itself are not listed here.

(I think this might be a recent update to the guide)

I've updated the PR to remove this test specific bug id.

Copy link

@msheppar msheppar left a comment

Choose a reason for hiding this comment

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

LGTM

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 3, 2025
Copy link
Member

@stuart-marks stuart-marks left a comment

Choose a reason for hiding this comment

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

@msheppar Good point about the bug tag! I hadn't seen that before.

@jaikiran Thanks for updates. Changes re-reviewed.

@jaikiran
Copy link
Member Author

jaikiran commented Dec 4, 2025

Thank you Mark and Stuart for the reviews. The test continues to pass in our CI with these changes. I'll go ahead and integrate this now.

@jaikiran
Copy link
Member Author

jaikiran commented Dec 4, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Dec 4, 2025

Going to push as commit 04c0f8d.
Since your change was applied there have been 78 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 Dec 4, 2025
@openjdk openjdk bot closed this Dec 4, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 4, 2025
@openjdk
Copy link

openjdk bot commented Dec 4, 2025

@jaikiran Pushed as commit 04c0f8d.

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

@jaikiran jaikiran deleted the 8372857 branch December 4, 2025 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants