question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mockito 2.6.4 hangs on JDK 1.8.0_31

See original GitHub issue

We just upgraded to Mockito 2.6.4. When we run our tests on Travis CI without the oracle-java8-installer, JDK 1.8.0_31 is used. We then have two threads hanging in the following state:

"pool-1-thread-2" #24 prio=5 os_prio=0 tid=0x00007fcd208ca800 nid=0x27b3 in Object.wait() [0x00007fcc8c1a1000]
   java.lang.Thread.State: RUNNABLE
        at net.bytebuddy.description.type.TypeDescription$Generic.<clinit>(TypeDescription.java:319)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:363)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:334)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:231)
        at org.mockito.internal.creation.bytebuddy.SubclassBytecodeGenerator.mockClass(SubclassBytecodeGenerator.java:66)
        at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator$1.call(TypeCachingBytecodeGenerator.java:35)
        at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator$1.call(TypeCachingBytecodeGenerator.java:32)
        at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:138)
        at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:346)
        at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:161)
        - locked <0x0000000689673668> (a java.lang.Class for com.microsoft.windowsazure.services.servicebus.ServiceBusContract)
        at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:355)
        at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.mockClass(TypeCachingBytecodeGenerator.java:30)
        at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMockType(SubclassByteBuddyMockMaker.java:71)
        at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMock(SubclassByteBuddyMockMaker.java:42)
        at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:26)
        at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35)
        at org.mockito.internal.MockitoCore.mock(MockitoCore.java:65)
        at org.mockito.Mockito.mock(Mockito.java:1681)
        at org.mockito.Mockito.mock(Mockito.java:1594)

The issue reported here does not reproduce with Mockito 2.6.3. It also does not reproduce with JDK 1.8.0_121. I assume it’s caused by #891.

(I know upgrading our JDK would be “better”, but if at all possible I’d like to see this fixed anyway, because using the oracle-java8-installer introduces a dependency on the Oracle website, and we’ve seen it being down from time-to-time, thus affecting our build stability.)

CC @raphw. (If you want me to file such tickets directly against Byte Buddy, let me know.)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
mockitoguycommented, Jan 24, 2017

This bug was really tricky. @raphw and @bric3 THANK you for being super fast in reacting to issues reported by our users. It’s a pleasure working on open source together 🥇

@Stephan202, thank you for confirming the bug is fixed and reporting this issue diligently. It is very helpful to us when we get comprehensive bug reports such as this one.

0reactions
Stephan202commented, Jan 23, 2017

@raphw, thanks! I’ve tested with version 2.6.8 and can confirm the fix works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mockito error in Spring Boot tests after migrating to JDK 11
Mockito error in Spring Boot tests after migrating to JDK 11 ... I have just migrated to JDK 11 in order to use...
Read more >
Consolidated JDK 8 Release Notes - Oracle
The incorrect fix can trigger crashes in the Java Virtual Machine. Upgrading the kernel to a version that includes the corrected fix addresses...
Read more >
Unable to install Java JDK or Runtime · Issue #49 - GitHub
Attempting to use apt-get install default-jdk (or the jre) results in several dependency failures and the package cannot be installed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found