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

8266461: tools/jmod/hashes/HashesTest.java fails: static @Test methods #1252

Closed
wants to merge 2 commits into from

Conversation

gdams
Copy link
Member

@gdams gdams commented Jul 21, 2022

Backport required to bump JDK11u to jtreg 6

test/jdk/tools/jmod/hashes/HashesTest.java

  • several occurrences of ht.checkHashes("j2", Set.of("j3")); (in jdk) not matching up with ht.checkHashes("j2", "j3"); in jdk11u.
  • testHashModulesPattern does not exist in jdk11u so I removed it from the patch.

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

Issues

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev pull/1252/head:pull/1252
$ git checkout pull/1252

Update a local copy of the PR:
$ git checkout pull/1252
$ git pull https://git.openjdk.org/jdk11u-dev pull/1252/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1252

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/1252.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 21, 2022

👋 Welcome back gdams! 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 changed the title Backport e90388bc1e7bba92675fa799d9da77aa4d6e1a05 8266461: tools/jmod/hashes/HashesTest.java fails: static @Test methods Jul 21, 2022
@openjdk
Copy link

openjdk bot commented Jul 21, 2022

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Jul 21, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 21, 2022

Webrevs

@gdams gdams mentioned this pull request Jul 21, 2022
3 tasks
@gdams
Copy link
Member Author

gdams commented Jul 21, 2022

@GoeLin please can you review and then I'll kick off the integration

@GoeLin
Copy link
Member

GoeLin commented Jul 22, 2022

I had the patch in our nightly build. The test is still failing.

/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:130: error: incompatible types: String cannot be converted to Set
checkHashes("m2", "m1");
^
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:134: error: incompatible types: String cannot be converted to Set
checkHashes("m2", "m1");
^
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:141: error: incompatible types: String cannot be converted to Set
checkHashes("m2", "m1");
^
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:142: error: incompatible types: String cannot be converted to Set
checkHashes("m3", "m1");
^
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:149: error: incompatible types: String cannot be converted to Set
checkHashes("org.bar", "org.foo");
^
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:152: error: method checkHashes in class HashesTest cannot be applied to given types;
checkHashes("m3", "org.foo", "org.bar", "m1");
^
required: String,Set
found: String,String,String,String
reason: actual and formal argument lists differ in length
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:188: error: incompatible types: String cannot be converted to Set
checkHashes("y1", "y2");
^
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:189: error: method checkHashes in class HashesTest cannot be applied to given types;
checkHashes("z1", "z2", "z3", "y2");
^
required: String,Set
found: String,String,String,String
reason: actual and formal argument lists differ in length
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:230: error: incompatible types: String cannot be converted to Set
checkHashes("j2", "j3");
^
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:231: error: method checkHashes in class HashesTest cannot be applied to given types;
checkHashes("j1", "m1", "m2", "m3", "j3");
^
required: String,Set
found: String,String,String,String,String
reason: actual and formal argument lists differ in length
/System/Volumes/Data/priv/jvmtests/output_openjdk11_dev_dbgU_darwinintel64/grmpf/testdata/jtreg/jtreg_test_11/test/jdk/tools/jmod/hashes/HashesTest.java:304: error: incompatible types: String cannot be converted to Set
checkHashes("m1", "m2");

@gdams
Copy link
Member Author

gdams commented Jul 22, 2022

@GoeLin thats interesting to know. Let me take another look at the patch

@gdams
Copy link
Member Author

gdams commented Jul 22, 2022

@GoeLin I've pushed up a commit to align the patch better with upstream and fixes all but one test:

test HashesTest.testReproducibibleHash(): failure
java.lang.AssertionError: Maps do not match for key:m2 actual:jdk.internal.module.ModuleHashes@115b3f30 expected:jdk.internal.module.ModuleHashes@405f34b
	at org.testng.Assert.fail(Assert.java:99)
	at org.testng.Assert.assertEquals(Assert.java:1458)
	at org.testng.Assert.assertEquals(Assert.java:1412)
	at HashesTest.testReproducibibleHash(HashesTest.java:297)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
	at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
	at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
	at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.testng.TestRunner.privateRun(TestRunner.java:764)
	at org.testng.TestRunner.run(TestRunner.java:585)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
	at org.testng.SuiteRunner.run(SuiteRunner.java:286)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
	at org.testng.TestNG.runSuites(TestNG.java:1069)
	at org.testng.TestNG.run(TestNG.java:1037)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:93)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:53)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
	at java.base/java.lang.Thread.run(Thread.java:829)

Any ideas?

@openjdk-notifier
Copy link

@gdams Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@RealCLanger
Copy link
Contributor

I'm looking into the HashesTest and see if I can figure out something. BTW, when backporting this change you should either backport https://bugs.openjdk.org/browse/JDK-8266461 right thereafter or maybe even include the typo fix and add JDK-8266461 to this PR via the /issue command.

@gdams
Copy link
Member Author

gdams commented Jul 22, 2022

Ignore my comments. Just tested with 11.0.16 and it works just fine:

➜  jdk11u-dev git:(hashes) ✗ java -version
openjdk version "11.0.16-beta" 2022-07-19
OpenJDK Runtime Environment Temurin-11.0.16+7-202207191813 (build 11.0.16-beta+7-202207191813)
OpenJDK 64-Bit Server VM Temurin-11.0.16+7-202207191813 (build 11.0.16-beta+7-202207191813, mixed mode)
➜  jdk11u-dev git:(hashes) ✗ jtreg test/jdk/tools/jmod/hashes/HashesTest.java                    
Test results: passed: 1
Report written to /Users/gadams/jdk11u-dev/JTreport/html/report.html
Results written to /Users/gadams/jdk11u-dev/JTwork

@gdams
Copy link
Member Author

gdams commented Jul 22, 2022

/issue add JDK-8267180

@openjdk
Copy link

openjdk bot commented Jul 22, 2022

@gdams
Adding additional issue to issue list: 8267180: Typo in copyright header for HashesTest.

Copy link
Contributor

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

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

Thumbs up. Backport looks good and test passed my local testing on both, Linux and Mac.

@openjdk
Copy link

openjdk bot commented Jul 22, 2022

@gdams This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

8266461: tools/jmod/hashes/HashesTest.java fails: static @Test methods
8267180: Typo in copyright header  for HashesTest

Reviewed-by: clanger

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

  • 1a66d5a: 8272352: Java launcher can not parse Chinese character when system locale is set to UTF-8
  • 5a1377d: 8290813: jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java fails: assertEquals is ambiguous
  • 16a84de: 8266460: java.io tests fail on null stream with upgraded jtreg/TestNG
  • 533a4e6: 8266250: WebSocketTest and WebSocketProxyTest call assertEquals(List<byte[]>, List<byte[]>)
  • 664f2ab: 8282280: Update Xerces to Version 2.12.2
  • 13b4420: 8271010: vmTestbase/gc/lock/malloc/malloclock04/TestDescription.java crashes intermittently
  • 517a18e: 8288360: CI: ciInstanceKlass::implementor() is not consistent for well-known classes
  • 9d8e388: 8208471: nsk/jdb/unwatch/unwatch002/unwatch002.java fails with "Prompt is not received during 300200 milliseconds"
  • 11eed37: 8266774: System property values for stdout/err on Windows UTF-8
  • 77d9210: 8289486: Improve XSLT XPath operators count efficiency
  • ... and 5 more: https://git.openjdk.org/jdk11u-dev/compare/1f4028960a3934853104efd1d95991b137b5f520...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.

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 (@RealCLanger) 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 Jul 22, 2022
@gdams
Copy link
Member Author

gdams commented Jul 23, 2022

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jul 23, 2022
@openjdk
Copy link

openjdk bot commented Jul 23, 2022

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

@RealCLanger
Copy link
Contributor

Passed SAP's nightlies.

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 24, 2022

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

  • 1a66d5a: 8272352: Java launcher can not parse Chinese character when system locale is set to UTF-8
  • 5a1377d: 8290813: jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java fails: assertEquals is ambiguous
  • 16a84de: 8266460: java.io tests fail on null stream with upgraded jtreg/TestNG
  • 533a4e6: 8266250: WebSocketTest and WebSocketProxyTest call assertEquals(List<byte[]>, List<byte[]>)
  • 664f2ab: 8282280: Update Xerces to Version 2.12.2
  • 13b4420: 8271010: vmTestbase/gc/lock/malloc/malloclock04/TestDescription.java crashes intermittently
  • 517a18e: 8288360: CI: ciInstanceKlass::implementor() is not consistent for well-known classes
  • 9d8e388: 8208471: nsk/jdb/unwatch/unwatch002/unwatch002.java fails with "Prompt is not received during 300200 milliseconds"
  • 11eed37: 8266774: System property values for stdout/err on Windows UTF-8
  • 77d9210: 8289486: Improve XSLT XPath operators count efficiency
  • ... and 5 more: https://git.openjdk.org/jdk11u-dev/compare/1f4028960a3934853104efd1d95991b137b5f520...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jul 24, 2022

@RealCLanger @gdams Pushed as commit 0b54c61.

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

@gdams gdams deleted the hashes branch July 24, 2022 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
3 participants