drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Farkas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5170) JMockit-based unit tests fail when run under Java 8
Date Fri, 26 Jan 2018 03:01:00 GMT

    [ https://issues.apache.org/jira/browse/DRILL-5170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16340503#comment-16340503
] 

Timothy Farkas commented on DRILL-5170:
---------------------------------------

Note: The vast majority of the usages of JMockit have been removed in DRILL-5730 so I am marking
this as a duplicate. The remaining usages will have to be removed in separate tasks. The complication
comes from the fact that JMockit allows you to mock static methods (which is pretty crazy)
and the remaining tests depend completely on that feature. Some refactoring of the tests and
some significant refactoring of Drill will have to be done in some cases. These straggling
tests should be done as separate tasks on an as needed basis since the work is somewhat significant
and there aren't that many left. 

> JMockit-based unit tests fail when run under Java 8
> ---------------------------------------------------
>
>                 Key: DRILL-5170
>                 URL: https://issues.apache.org/jira/browse/DRILL-5170
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>            Reporter: Paul Rogers
>            Priority: Minor
>
> 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:
> {code}
> 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)
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message