Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-2544

Some test cases using PowerMock fail with Java 8u20

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.2, 1.1.0
    • Component/s: None
    • Labels:
      None

      Description

      I observed that some of the test cases using PowerMockRunner fail with Java 8u20 with the following error:

      java.lang.VerifyError: Bad <init> method call from inside of a branch
      Exception Details:
        Location:
          org/apache/flink/client/program/ClientTest$SuccessReturningActor.<init>()V @32: invokespecial
        Reason:
          Error exists in the bytecode
        Bytecode:
          0x0000000: 2a4c 1214 b800 1a03 bd00 0d12 1bb8 001f
          0x0000010: b800 254e 2db2 0029 a500 0e2a 01c0 002b
          0x0000020: b700 2ea7 0009 2bb7 0030 0157 2a01 4c01
          0x0000030: 4d01 4e2b 01a5 0008 2b4e a700 0912 32b8
          0x0000040: 001a 4e2d 1234 03bd 000d 1236 b800 1f12
          0x0000050: 32b8 003a 3a04 1904 b200 29a6 000a b800
          0x0000060: 3c4d a700 0919 04c0 0011 4d2c b800 42b5
          0x0000070: 0046 b1                                
        Stackmap Table:
          full_frame(@38,{UninitializedThis,UninitializedThis,Top,Object[#13]},{})
          full_frame(@44,{Object[#2],Object[#2],Top,Object[#13]},{})
          full_frame(@61,{Object[#2],Null,Null,Null},{Object[#2]})
          full_frame(@67,{Object[#2],Null,Null,Object[#15]},{Object[#2]})
          full_frame(@101,{Object[#2],Null,Null,Object[#15],Object[#13]},{Object[#2]})
          full_frame(@107,{Object[#2],Null,Object[#17],Object[#15],Object[#13]},{Object[#2]})
      
      	at java.lang.Class.getDeclaredConstructors0(Native Method)
      	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
      	at java.lang.Class.getConstructor0(Class.java:3062)
      	at java.lang.Class.getDeclaredConstructor(Class.java:2165)
      	at akka.util.Reflect$$anonfun$4.apply(Reflect.scala:86)
      	at akka.util.Reflect$$anonfun$4.apply(Reflect.scala:86)
      	at scala.util.Try$.apply(Try.scala:161)
      	at akka.util.Reflect$.findConstructor(Reflect.scala:86)
      	at akka.actor.NoArgsReflectConstructor.<init>(Props.scala:359)
      	at akka.actor.IndirectActorProducer$.apply(Props.scala:308)
      	at akka.actor.Props.producer(Props.scala:176)
      	at akka.actor.Props.<init>(Props.scala:189)
      	at akka.actor.Props$.create(Props.scala:99)
      	at akka.actor.Props$.create(Props.scala:99)
      	at akka.actor.Props.create(Props.scala)
      	at org.apache.flink.client.program.ClientTest.shouldSubmitToJobClient(ClientTest.java:143)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:68)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:310)
      	at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:88)
      	at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:96)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:294)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTestInSuper(PowerMockJUnit47RunnerDelegateImpl.java:127)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTest(PowerMockJUnit47RunnerDelegateImpl.java:82)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:282)
      	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:86)
      	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:207)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:146)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
      	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:33)
      	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:45)
      	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:118)
      	at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:104)
      	at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
      	at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:53)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
      

      Affected tests are: ClientTest.shouldSubmitToJobClient, ClientTest.shouldSubmitToJobClientFails, DataSourceTaskTest, DataSinkTaskTest and ChainTaskTest. This list, however, is by no means complete.

      With the latest java version Java 8u51, the tests pass, though. The problem might be related to https://code.google.com/p/powermock/issues/detail?id=505 and to https://bugs.openjdk.java.net/browse/JDK-8051012

      I propose to either document this fact more prominently or to rewrite the affected tests so that they also run with Java 8u20.

        Attachments

          Activity

            People

            • Assignee:
              spkavulya Soila Kavulya
              Reporter:
              trohrmann Till Rohrmann

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment