JDK-8275173 : testlibrary_tests/ir_framework/tests/TestCheckedTests.java fails after JDK-8274911
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-10-12
  • Updated: 2022-12-29
  • Resolved: 2021-10-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 18
17.0.7-oracleFixed 18 b19Fixed
Related Reports
Duplicate :  
Relates :  
Description
/home/jdk/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCheckedTests.java:47: error: method shouldHaveThrownException in class Utils cannot be applied to given types;
            Utils.shouldHaveThrownException();
                 ^
  required: String
  found:    no arguments
  reason: actual and formal argument lists differ in length
/home/jdk/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCheckedTests.java:58: error: method shouldHaveThrownException in class Utils cannot be applied to given types;
            Utils.shouldHaveThrownException();
                 ^
  required: String
  found:    no arguments
  reason: actual and formal argument lists differ in length
Comments
Fix request [17u] I backport this for parity with 17.0.7-oracle. Required follow up of 8273410. No risk, only a test change. Clean backport. Test passes. SAP nightly testing passed.
28-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/989 Date: 2022-12-27 11:56:55 +0000
27-12-2022

[~chagedorn] - Thanks for clearing up the mystery.
14-10-2021

Yes, I always test tier5 when modifying anything related to the IR framework. Running the IR framework internal tests in tier5 only was a trade-off decision between the confidence of frequent testing vs. usage of actually doing so given that the framework will not change that often. Here the problem was simply that I integrated JDK-8273410 (edit) but forgot to update my local repo afterwards when fixing this issue and when running tests for this fix - a silly mistake. I mentioned it in the review. I'm sorry for all the trouble!
14-10-2021

[~dholmes] I mixed the JBS number up, I've meant JDK-8273410 (which added TestCheckedTests.java) in the comment above. In summary: I branched JDK-8273410 from master just before the integration of JDK-8273410. A few days later, when starting to work on JDK-8274911, which was a completely different issue, I branched again from the same state of the master branch which has not contained JDK-8273410 and the test, yet. So, the mistake was that I missed the dependency to JDK-8273410 when fixing JDK-8274911. As you said, it was kinda bad luck having this reverse dependency of otherwise unrelated changes. I'm not sure if this could have been prevented apart from just syncing the repos more often.
14-10-2021

[~chagedorn] are you saying that when you fixed JDK-8274911 your local repo was missing the test file TestCheckedTests.java ? Edit: I can see from your source bundle that was indeed the case. Trying to think if there is anything we can do to help prevent oversights like this from happening ... I guess in some sense it was just bad luck that your fix did not depend on any of the missing changes, yet part of the missing changes had a dependency on your fix.
14-10-2021

[~dcubed] I share your confusion. I also investigated and cannot figure out why the preintegration testing with tier5 actually failed to run the test in question! If you look at the test history none of Christian's jobs show up for October 11.
14-10-2021

I was trying to figure how out a compilation failure made it all the way out to Tier5 before logging a failure... Apparently the test: testlibrary_tests/ir_framework/tests/TestCheckedTests.java isn't executed in Tier[1-4]. Don't know if that's intentional or not, but that means changes to that test (and probably dependent libraries) have to be tested with Mach5 Tier5 specifically. GHA only runs the equivalent of Tier1 and obviously Mach5 Tier[1-4] won't do either. It looks like: JDK-8274911 testlibrary_tests/ir_framework/tests/TestIRMatching.java fails with "java.lang.RuntimeException: Should have thrown exception" was tested with Tier1 and Tier5 so I'm confused.
13-10-2021

Changeset: 451a2965 Author: Jie Fu <jiefu@openjdk.org> Date: 2021-10-13 14:30:11 +0000 URL: https://git.openjdk.java.net/jdk/commit/451a296510994ff9fe1e0381900ffa9a8a1caa54
13-10-2021

ILW = Test cannot be compiled/run due to changes in used library method, single test always triggered, no workaround = MMH = P3
13-10-2021

Suggested fix: ``` diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCheckedTests.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCheckedTests.java index b6e28cb3bea..6a8d5c50c6a 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCheckedTests.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCheckedTests.java @@ -26,6 +26,8 @@ package ir_framework.tests; import compiler.lib.ir_framework.*; import compiler.lib.ir_framework.driver.IRViolationException; import compiler.lib.ir_framework.driver.TestVMException; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; import jdk.test.lib.Asserts; /* @@ -41,11 +43,17 @@ public class TestCheckedTests { public int iFld; public static void main(String[] args) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos); + PrintStream oldOut = System.out; + System.setOut(ps); + TestFramework.run(); try { TestFramework.run(BadIRAndRuntimeCheckedTests.class); - Utils.shouldHaveThrownException(); + Utils.shouldHaveThrownException(baos.toString()); } catch (TestVMException e) { + System.setOut(oldOut); Asserts.assertTrue(e.getExceptionInfo().contains("Test Failures (2)")); Asserts.assertTrue(e.getExceptionInfo().contains("checkTestBad3")); Asserts.assertTrue(e.getExceptionInfo().contains("checkTestBad5")); @@ -53,10 +61,12 @@ public class TestCheckedTests { Asserts.assertFalse(e.getExceptionInfo().contains("Failed IR Rules")); } + System.setOut(ps); try { TestFramework.run(BadIRCheckedTests.class); - Utils.shouldHaveThrownException(); + Utils.shouldHaveThrownException(baos.toString()); } catch (IRViolationException e) { + System.setOut(oldOut); Asserts.assertTrue(e.getExceptionInfo().contains("Failed IR Rules (3)")); } } ```
13-10-2021