Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5170

JMockit-based unit tests fail when run under Java 8

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.8.0
    • Fix Version/s: 1.13.0
    • Component/s: None
    • Labels:
      None

      Description

      Drill makes extensive use of the JMockit mocking library. Drill uses a very old version of JMockit. JMockit appears to perform byte-code manipulations that are incompatible with Java 8. For example:

      cd exec/java-exec/
      mvn surefire:test -Dtest=TestSimpleProjection
      Running org.apache.drill.exec.physical.impl.project.TestSimpleProjection#project
      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.794 sec <<< FAILURE! - in org.apache.drill.exec.physical.impl.project.TestSimpleProjection
      project(org.apache.drill.exec.physical.impl.project.TestSimpleProjection)  Time elapsed: 0.215 sec  <<< ERROR!
      java.lang.VerifyError: null
      	at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      

      A similar error occurs when running the same unit test under Eclipse.

      Fixing this issue is non-trivial. Mockito is subject to rapid change. The semantics of mocks has changed significantly. Code that works fine in our old version requires extensive rework to work with the current version.

      For now, the only workaround is to compile Drill under the (obsolete) Java 7 and use that version to run unit tests.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                timothyfarkas Timothy Farkas
                Reporter:
                paul-rogers Paul Rogers
                Reviewer:
                Boaz Ben-Zvi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: