JDK-8208237 : Re-examine defmeth tests and update as needed
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9,11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-07-25
  • Updated: 2025-01-24
  • Resolved: 2021-05-11
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
17 b22Fixed
Related Reports
Relates :  
Description
David Holmes reports:

While updating defmeth tests for nestmates (JEP 181) I encountered a number of issues:

1. Known failure modes that seem out of date

With the following patch the basic* test still all pass:

diff -r 2657e4188322 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
--- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
+++ b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
@@ -150,7 +150,6 @@
      * }
      *
      */
-    @KnownFailure(modes = {INVOKE_EXACT, INVOKE_GENERIC, INVOKE_WITH_ARGS, INDY}) // NPE, instead of IAE
     public void testNonPublicOverride() {
         TestBuilder b = factory.getBuilder();


2. Expected exceptions are far too broad in some cases ie LinkageError instead of a more specific IllegalAccessError, or NoSuchMethodError, or AbstractMehtodError. Tests could pass yet actually be encountering completely wrong exceptions.

3. Reflection tests often fail with NoSuchMethodError. This suggests that in some cases we may be looking up the method on the wrong class, or using getMethod instead of getDeclaredMethod.
Comments
Changeset: acf02ed5 Author: Vladimir Ivanov <vlivanov@openjdk.org> Date: 2021-05-11 17:14:57 +0000 URL: https://git.openjdk.java.net/jdk/commit/acf02ed5533e25ec572d18ff874a241860c66bed
11-05-2021

I may have time to look into it once I start working on default method support in CHA for JIT-compilers (JDK-8036580).
22-02-2019

I'd image [~vlivanov] is still able to understand how the test generation framework works.
22-02-2019

This is not a high priority at this time, and there is no-one who understands how this test generation framework actually operates. We can revisit this in the future if needed.
22-02-2019