Skip to content

8373289: Test tools/javac/patterns/Exhaustiveness.java timed out then passed#31020

Open
lahodaj wants to merge 3 commits intoopenjdk:masterfrom
lahodaj:JDK-8373289
Open

8373289: Test tools/javac/patterns/Exhaustiveness.java timed out then passed#31020
lahodaj wants to merge 3 commits intoopenjdk:masterfrom
lahodaj:JDK-8373289

Conversation

@lahodaj
Copy link
Copy Markdown
Contributor

@lahodaj lahodaj commented May 4, 2026

The test/langtools/tools/javac/patterns/Exhaustiveness.java contains some degree of randomness (it will generate a big switch, and randomly remove a case from the switch, observing the outcomes). But, both generating the big switch, and the exhaustiveness computation process in javac as such are currently not deterministic, which leads to problems with reproducing any timeout/failure of the test.

The intent in this PR is to ensure the exhaustiveness computation is deterministic, by using LinkedHashSet and LinkedHashMap.

With this change, if the test fails, there will be a better chance on reproducing the failure.



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-8373289: Test tools/javac/patterns/Exhaustiveness.java timed out then passed (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31020

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 4, 2026

👋 Welcome back jlahoda! 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
Copy Markdown

openjdk Bot commented May 4, 2026

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

@openjdk openjdk Bot added the compiler compiler-dev@openjdk.org label May 4, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 4, 2026

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

  • compiler

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 May 4, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 4, 2026

Webrevs

tb = new ToolBox();
}

public void runTests() throws Exception {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need @Override for this method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler compiler-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants