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

revisit disabled tests #10917

Closed
llxia opened this issue Oct 16, 2020 · 30 comments
Closed

revisit disabled tests #10917

llxia opened this issue Oct 16, 2020 · 30 comments

Comments

@llxia
Copy link
Contributor

llxia commented Oct 16, 2020

We should revisit disabled tests to see if the issues are resolved. If they are, we need to re-enable the tests. For these ones that do not have any comments, we should check them again.

For example:
https://github.com/eclipse/openj9/blob/ad7c3f09279a54f8d4d253af03da2a2a31f86f8e/test/functional/cmdLineTests/modularityddrtests/playlist.xml#L26
https://github.com/eclipse/openj9/blob/e2c38649abb06128ee30c06691b6dcc9e19db55b/test/functional/VM_Test/playlist.xml#L148
https://github.com/eclipse/openj9/blob/ab7f03ab6faa069307a3ddedf09ac26f79b9702c/test/functional/cmdLineTests/pltest/playlist.xml#L175

@llxia
Copy link
Contributor Author

llxia commented Jun 12, 2023

@KapilPowar could you take a look at this issue? Thanks

@KapilPowar
Copy link
Contributor

@pshipton

While testing VM test suite for JDK8 we are seeing test case failures.
https://github.com/eclipse/openj9/blob/e2c38649abb06128ee30c06691b6dcc9e19db55b/test/functional/VM_Test/playlist.xml#L148

Here is the grinder link

Test cases enabled --
recreateClassTest (1/20 failed )
CFdumptest (1/8 failed)

There was 1 failure:
17:13:10  1) testInnerClasses(com.ibm.j9.recreateclass.tests.RecreateClassCompareTest)junit.framework.AssertionFailedError: Incorrect number of mismatches found expected:<1> but was:<5>
17:13:10  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.compareClassFiles(RecreateClassCompareTest.java:63)
17:13:10  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.runCfdumpAndCompareTools(RecreateClassCompareTest.java:74)
17:13:10  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.runTest(RecreateClassCompareTest.java:86)
17:13:10  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.runTest(RecreateClassCompareTest.java:79)
17:13:10  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.testInnerClasses(RecreateClassCompareTest.java:154)
17:13:10  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:13:10  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
17:13:10  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:13:10  
17:13:10  FAILURES!!!
17:13:10  Tests run: 20,  Failures: 1,  Errors: 0
--------------------------------------------------------------------
CFdumptest (1/8 failed)

There was 1 failure:
17:13:11  1) testInvalidClassFile(com.ibm.j9.cfdump.tests.lineardump.LinearDumpTests)junit.framework.AssertionFailedError: Expected: <null> but was: bad magic number
17:13:11  	at com.ibm.j9.cfdump.tests.lineardump.LinearDumpTests.testInvalidClassFile(LinearDumpTests.java:123)
17:13:11  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:13:11  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
17:13:11  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:13:11  
17:13:11  FAILURES!!!
17:13:11  Tests run: 8,  Failures: 1,  Errors: 0

Please confirm if it is product issue.

@pshipton
Copy link
Member

pshipton commented Aug 4, 2023

How do I re-run these tests? The grinder link is expired. When I try to run them every test fails with Error: cfdump not found on java.library.path!. I see that cfdump is part of the test image.

https://openj9-jenkins.osuosl.org/view/Test/job/Grinder/2649

@KapilPowar
Copy link
Contributor

In playlist.xml file please try to add cfdump in the lib path - using $(ADD_JVM_LIB_DIR_TO_LIBPATH) \ in <command>
for the test cases.

e.g.
<command>$(ADD_JVM_LIB_DIR_TO_LIBPATH) \ $(JAVA_COMMAND) $(JVM_OPTIONS) \

@KapilPowar
Copy link
Contributor

Here are latest Grinder Links
aarch64_linux --Java 8
x86-64_linux -- Java 8
x86-64_windows -- Java 8

@pshipton
Copy link
Member

Failure details from recreateClassTest

13:15:46  Start testInnerClasses
13:15:46  Running command: /home/jenkins/workspace/Grinder/openjdkbinary/openjdk-test-image/openj9/cfdump -t:/home/jenkins/workspace/Grinder/aqa-tests/TKG/output_16917741452730/recreateClassTest_0/InnerClassesTest /home/jenkins/workspace/Grinder/aqa-tests/TKG/output_16917741452730/recreateClassTest_0/InnerClassesTest.class
13:15:46  cfdump: Wrote 1212 bytes to output file /home/jenkins/workspace/Grinder/aqa-tests/TKG/output_16917741452730/recreateClassTest_0/InnerClassesTest.j9class
13:15:46  Inner class access flags differ: 0X8, 0X0
13:15:46  Aug 11, 2023 5:15:46 PM com.ibm.j9.test.tools.classfilecompare.ClassFileCompare reportDifference
13:15:46  WARNING: Inner class access flags differ: 0X8, 0X0
13:15:46  Inner class inner name differ: LocalClass, null
13:15:46  Aug 11, 2023 5:15:46 PM com.ibm.j9.test.tools.classfilecompare.ClassFileCompare reportDifference
13:15:46  WARNING: Inner class inner name differ: LocalClass, null
13:15:46  Inner class access flags differ: 0X8, 0X0
13:15:46  Aug 11, 2023 5:15:46 PM com.ibm.j9.test.tools.classfilecompare.ClassFileCompare reportDifference
13:15:46  WARNING: Inner class access flags differ: 0X8, 0X0
13:15:46  Inner class access flags differ: 0X9, 0X0
13:15:46  Aug 11, 2023 5:15:46 PM com.ibm.j9.test.tools.classfilecompare.ClassFileCompare reportDifference
13:15:46  WARNING: Inner class access flags differ: 0X9, 0X0
13:15:46  Inner class inner name differ: InnerClass, null
13:15:46  Aug 11, 2023 5:15:46 PM com.ibm.j9.test.tools.classfilecompare.ClassFileCompare reportDifference
13:15:46  WARNING: Inner class inner name differ: InnerClass, null
13:15:46  Mismatches spotted: 5

@pshipton
Copy link
Member

@TobiAjila can someone pls take a look at this recreateClassTest failure in the previous comment, it appears we may need a fix.

My changes to run the tests and add debug are in https://github.com/pshipton/openj9/tree/tests

@tajila
Copy link
Contributor

tajila commented Aug 11, 2023

@hangshao0 Can you please take a look at this

@pshipton
Copy link
Member

Re-enabling CFdumptest via #17939

@hangshao0
Copy link
Contributor

I will look at this.

@hangshao0
Copy link
Contributor

I've manually run cfdump on the inner class. Looking at the generated j9class and original class file:

cfdump -d 'InnerClassesTest$InnerClass.class'
Magic: CAFEBABE
Version: 52.0
Constant Pool Size: 17
Access Flags: 0x21 (
  access: public super )
ThisClass: 2 -> InnerClassesTest$InnerClass
SuperClass: 3 -> java/lang/Object
Interfaces (0):

Fields (0):
Methods (1):
  Name: 4 -> <init>
  Signature: 5 -> ()V
  Access Flags: 0x1 (
  access: public )
  Attributes (1):
    Code:
      Max stack: 1
      Max Locals: 1
      Code Length: 5
      Caught Exceptions (0):
      Attributes (1):
        LineNumberTable:
          pc: 0 line number: 2

Attributes (2):
  SourceFile:
    Source File: 9 -> InnerClassesTest.java
  InnerClasses:
    Inner Class: 2 -> InnerClassesTest$InnerClass
      Outer Class: 11 -> InnerClassesTest
      Inner Name: 13 -> InnerClass
      Inner Class Access Flags: 0x9 (
  access: public )
cfdump -d 'InnerClassesTest$InnerClass.j9class'
Magic: CAFEBABE
Version: 52.0
Constant Pool Size: 17
Access Flags: 0x21 (
  access: public super )
ThisClass: 5 -> InnerClassesTest$InnerClass
SuperClass: 2 -> java/lang/Object
Interfaces (0):

Fields (0):
Methods (1):
  Name: 15 -> <init>
  Signature: 3 -> ()V
  Access Flags: 0x1 (
  access: public )
  Attributes (1):
    Code:
      Max stack: 1
      Max Locals: 1
      Code Length: 5
      Caught Exceptions (0):
      Attributes (1):
        LineNumberTable:
          pc: 0 line number: 2

Attributes (2):
  InnerClasses:
    Inner Class: 5 -> InnerClassesTest$InnerClass
      Outer Class: 12 -> InnerClassesTest
      Inner Name: 8 -> InnerClass
      Inner Class Access Flags: 0x9 (
  access: public )
  SourceFile:
    Source File: 13 -> InnerClassesTest.java

I see the access flags and inner class names are the same. The differences might be from the outer class that cause the test to fail.

@hangshao0
Copy link
Contributor

cfdump -d InnerClassesTest.class
Magic: CAFEBABE
Version: 52.0
Constant Pool Size: 24
Access Flags: 0x21 (
  access: public super )
ThisClass: 3 -> InnerClassesTest
SuperClass: 4 -> java/lang/Object
Interfaces (0):

Fields (0):
Methods (2):
  Name: 9 -> <init>
  Signature: 10 -> ()V
  Access Flags: 0x1 (
  access: public )
  Attributes (1):
    Code:
      Max stack: 1
      Max Locals: 1
      Code Length: 5
      Caught Exceptions (0):
      Attributes (1):
        LineNumberTable:
          pc: 0 line number: 1

  Name: 13 -> getLocalClass
  Signature: 14 -> ()Ljava/lang/Class;
  Access Flags: 0x9 (
  access: public static )
  Attributes (2):
    Code:
      Max stack: 1
      Max Locals: 0
      Code Length: 3
      Caught Exceptions (0):
      Attributes (1):
        LineNumberTable:
          pc: 0 line number: 8
    Signature:
      Signature: 16 -> ()Ljava/lang/Class<*>;

Attributes (2):
  SourceFile:
    Source File: 18 -> InnerClassesTest.java
  InnerClasses:
    Inner Class: 5 -> InnerClassesTest$InnerClass
      Outer Class: 3 -> InnerClassesTest
      Inner Name: 6 -> InnerClass
      Inner Class Access Flags: 0x9 (
  access: public )
    Inner Class: 2 -> InnerClassesTest$1LocalClass
      Outer Class: (not a member)
      Inner Name: 8 -> LocalClass
      Inner Class Access Flags: 0x0 (
  access: default )
cfdump -d InnerClassesTest.j9class
Magic: CAFEBABE
Version: 52.0
Constant Pool Size: 22
Access Flags: 0x21 (
  access: public super )
ThisClass: 7 -> InnerClassesTest
SuperClass: 3 -> java/lang/Object
Interfaces (0):

Fields (0):
Methods (2):
  Name: 21 -> <init>
  Signature: 14 -> ()V
  Access Flags: 0x1 (
  access: public )
  Attributes (1):
    Code:
      Max stack: 1
      Max Locals: 1
      Code Length: 5
      Caught Exceptions (0):
      Attributes (1):
        LineNumberTable:
          pc: 0 line number: 1

  Name: 12 -> getLocalClass
  Signature: 13 -> ()Ljava/lang/Class;
  Access Flags: 0x9 (
  access: public static )
  Attributes (2):
    Code:
      Max stack: 1
      Max Locals: 0
      Code Length: 3
      Caught Exceptions (0):
      Attributes (1):
        LineNumberTable:
          pc: 0 line number: 8
    Signature:
      Signature: 4 -> ()Ljava/lang/Class<*>;

Attributes (2):
  InnerClasses:
    Inner Class: 20 -> InnerClassesTest$InnerClass
      Outer Class: 7 -> InnerClassesTest
      Inner Name: (anonymous)                 <------------------------------------- this is different from the original class
      Inner Class Access Flags: 0x0 (         <------------------------------------- this is different from the original class
  access: default )
    Inner Class: 1 -> InnerClassesTest$1LocalClass
      Outer Class: (not a member)
      Inner Name: (anonymous)
      Inner Class Access Flags: 0x0 (
  access: default )
  SourceFile:
    Source File: 5 -> InnerClassesTest.java

The difference is from the inner class attribute of the outer class.
The inner class simple name and access flags are not preserved in the romClass of the outer class:

/* NOTE: innerClassAccessFlags and innerNameIndex are not preserved in the ROM class - technically incorrect, but this should only matter to compilers */
writeU16(0); /* innerNameIndex */
writeU16(0); /* innerClassAccessFlags */

If we decided to not record these information in the romClass in #13199, the test needs to be updated to accept such differences in .class and .j9class files.

@hangshao0
Copy link
Contributor

@ChengJin01 ^^

@llxia
Copy link
Contributor Author

llxia commented Aug 23, 2023

CFdumptest is only enabled for JDK8. I think it is able to run against all versions.
https://github.com/pshipton/openj9/blob/master/test/functional/VM_Test/playlist.xml#L167
@KapilPowar could you run CFdumptest on JDK11 and JDK17 when you have time? Thanks

@pshipton
Copy link
Member

I tried other versions but there are problems that would need to be resolved.

@KapilPowar
Copy link
Contributor

@llxia
Copy link
Contributor Author

llxia commented Aug 29, 2023

Thanks @KapilPowar . Could also run on other missing platforms in Grinder? Thanks

@KapilPowar
Copy link
Contributor

Grinder test runs for CFdumptest
JDK17
s390x_linux --UNSTABLE
aarch64_mac --Success
ppc64_aix --UNSTABLE

JDK11
aarch64_mac -- Success
s390x_linux--UNSTABLE
ppc64_aix --UNSTABLE

@KapilPowar
Copy link
Contributor

@llxia @pshipton FYI
Grinder test run for recreateClassTest still results in same error -- JDK8 x86-64_linux

There was 1 failure:
17:01:36  1) testInnerClasses(com.ibm.j9.recreateclass.tests.RecreateClassCompareTest)junit.framework.AssertionFailedError: Incorrect number of mismatches found expected:<1> but was:<5>
17:01:36  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.compareClassFiles(RecreateClassCompareTest.java:63)
17:01:36  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.runCfdumpAndCompareTools(RecreateClassCompareTest.java:74)
17:01:36  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.runTest(RecreateClassCompareTest.java:86)
17:01:36  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.runTest(RecreateClassCompareTest.java:79)
17:01:36  	at com.ibm.j9.recreateclass.tests.RecreateClassCompareTest.testInnerClasses(RecreateClassCompareTest.java:154)
17:01:36  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:01:36  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
17:01:36  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:01:36  
17:01:36  FAILURES!!!
17:01:36  Tests run: 20,  Failures: 1,  Errors: 0
17:01:36  
17:01:36  -----------------------------------
17:01:36  recreateClassTest_0_FAILED
17:01:36  -----------------------------------
 

@pshipton
Copy link
Member

I assume this can be moved forward.

@pshipton
Copy link
Member

Re #10917 (comment), we're waiting for @ChengJin01 to have time to take a look, based on #10917 (comment)

@ChengJin01
Copy link

I agree with @hangshao0 's investigation & conclusions given we don' record the access flags in the romClass by default.

@pshipton
Copy link
Member

So the next step is to update the test itself to ignore those differences. @TobiAjila

@KapilPowar
Copy link
Contributor

KapilPowar commented Sep 21, 2023

@llxia
Copy link
Contributor Author

llxia commented Sep 21, 2023

@KapilPowar if the Grinders pass, please create PR to reenable the tests. Thanks

@KapilPowar
Copy link
Contributor

@KapilPowar if the Grinders pass, please create PR to reenable the tests. Thanks

PR created #18181

@KapilPowar
Copy link
Contributor

@llxia
Grinder test run for TestFlushReflectionCache & jit_jitt_openj9_none_SCC
x86-64_linux
x86-64_mac
x86-64_windows

PR created #18206

@KapilPowar
Copy link
Contributor

@llxia
Grinder test run for cmdLineTester_dumpromclasstests
aix_ppc-64 JDK8
aix_ppc-64 JDK11
aix_ppc-64 JDK17

PR created #18215

@tajila
Copy link
Contributor

tajila commented May 14, 2024

@llxia Do we still need this issue?

@llxia
Copy link
Contributor Author

llxia commented Aug 13, 2024

I believe this issue can be closed.

@llxia llxia closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants