JDK-8194857 : [TESTBUG] Update SelectionResolution tests to work with JVMS changes introduced as part of nestmates
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2018-01-10
  • Updated: 2019-08-15
  • Resolved: 2019-02-25
Related Reports
Relates :  
Description
Along with direct nestmate support the JVMS changes to invokeinterface affect existing SelectionResolution tests.

For example, InvokeInterfaceICCE expects invokeinterface of a private method to throw ICCE because invokespecial is required to be used. But now invokeinterface is used instead so ICCE is not thrown. Hence this block had to be removed from the test:

!                 /* Group 175: private method in interface */
!                 new TestGroup.Simple(initBuilder,
!                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
!                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
!                                              EnumSet.of(MethodData.Access.PRIVATE),
!                                              EnumSet.of(MethodData.Context.INSTANCE),
!                                              EnumSet.of(ClassData.Package.SAME)),
!                         Template.OverrideAbstractExpectedIface,
!                         Template.MethodrefEqualsExpected,
!                         Template.IgnoredAbstract,
!                         Template.CallsiteEqualsMethodref,
!                         Template.IfaceMethodrefSelection)

so that it passes. But if I paste that block into the InvokeinterfaceSuccess test then that test fails.

Unfortunately the SelectionResolution tests are extremely hard to understand, and I can't tell from the error exactly what goes wrong. I suspect that this test block covers a multitude of test conditions, only a subset of which are affected by the change. So somehow the affected tests need to be extracted so that we can move only the appropriate ones to the "success" test.

Similarly the skipping of private methods when selecting the implementation to call for a resolved public method will require changes to other SelectionResolution tests.
Comments
The changes to interface method selection rules required further updates to the SelectionResolution tests. In this case I was able to make an adjustment at the second level in the Template IfaceMethodrefSelectionOverrideNonPublic by commenting out all the cases involving private interface methods. That meant that, compared to commenting out the top-level tests, instead of reducing the test count by 7800, it only reduced by 2600. http://cr.openjdk.java.net/~dholmes/8189163/webrev/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Template.java.frames.html Again these test cases need to be factored out and the ones that should now succeed, or throw a different exception, moved to a new test.
03-03-2018