{"action":"closed","issue":{"url":"https://api.github.com/repos/bndtools/bndtools/issues/1527","repository_url":"https://api.github.com/repos/bndtools/bndtools","labels_url":"https://api.github.com/repos/bndtools/bndtools/issues/1527/labels{/name}","comments_url":"https://api.github.com/repos/bndtools/bndtools/issues/1527/comments","events_url":"https://api.github.com/repos/bndtools/bndtools/issues/1527/events","html_url":"https://github.com/bndtools/bndtools/issues/1527","id":175610322,"number":1527,"title":"Removing @RunWith(MockitoJUnitRunner.class) from ExampleIntegrationTest deadlocks Gradle CLI build in :test :check","user":{"login":"vorburger","id":298598,"avatar_url":"https://avatars.githubusercontent.com/u/298598?v=3","gravatar_id":"","url":"https://api.github.com/users/vorburger","html_url":"https://github.com/vorburger","followers_url":"https://api.github.com/users/vorburger/followers","following_url":"https://api.github.com/users/vorburger/following{/other_user}","gists_url":"https://api.github.com/users/vorburger/gists{/gist_id}","starred_url":"https://api.github.com/users/vorburger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorburger/subscriptions","organizations_url":"https://api.github.com/users/vorburger/orgs","repos_url":"https://api.github.com/users/vorburger/repos","events_url":"https://api.github.com/users/vorburger/events{/privacy}","received_events_url":"https://api.github.com/users/vorburger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-07T21:25:12Z","updated_at":"2016-09-08T16:52:10Z","closed_at":"2016-09-08T16:52:10Z","body":"Here is a \"fun\" bug I've found by coincidence while playing around...\r\n\r\nRemoving @RunWith(MockitoJUnitRunner.class) from ExampleIntegrationTest deadlocks Gradle CLI build in :test :check!\r\n\r\nThis is easily reproducible by creating a New Bnd OSGi Project from template \"Integration Testing\". Running ExampleIntegrationTest in-IDE works, of course. Likewise, initially a ../gradlew build in it works too, of course, everything hunky dory:\r\n\r\n```\r\n:demo:check\r\nTests run  : 1\r\nPassed     : 1\r\n```\r\n\r\nNow remove the `@RunWith(MockitoJUnitRunner.class)` from the ExampleIntegrationTest - the example doesn't use Mockito, and I wasn't planning to use it for my [first enRoute integration test](http://enroute.osgi.org/tutorial_base/600-testing.html), so removed. Now re-run the Gradle build from the CLI, and watch it get \"stuck\" forever (deadlock) here:\r\n\r\n```\r\n:demo:test UP-TO-DATE\r\n> Building 81% > :demo:check\r\n```\r\n\r\nA `jstack PID` (where _PID_ is the one of `Launcher` shown by `jps`) shows this:\r\n```\r\n\r\n2016-09-07 23:23:01\r\nFull thread dump OpenJDK 64-Bit Server VM (25.102-b14 mixed mode):\r\n\r\n\"Attach Listener\" #22 daemon prio=9 os_prio=0 tid=0x00007f557c001000 nid=0x663e waiting on condition [0x0000000000000000]\r\n   java.lang.Thread.State: RUNNABLE\r\n\r\n\"FelixStartLevel\" #17 daemon prio=5 os_prio=0 tid=0x00007f55c41fa000 nid=0x65f7 in Object.wait() [0x00007f559acc4000]\r\n   java.lang.Thread.State: WAITING (on object monitor)\r\n\tat java.lang.Object.wait(Native Method)\r\n\t- waiting on <0x000000075aff66d0> (a java.util.ArrayList)\r\n\tat java.lang.Object.wait(Object.java:502)\r\n\tat org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:283)\r\n\t- locked <0x000000075aff66d0> (a java.util.ArrayList)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n\r\n\"FrameworkWaiter\" #16 prio=5 os_prio=0 tid=0x00007f55c41f9000 nid=0x65f6 in Object.wait() [0x00007f559aac2000]\r\n   java.lang.Thread.State: WAITING (on object monitor)\r\n\tat java.lang.Object.wait(Native Method)\r\n\t- waiting on <0x000000075b17b250> (a org.apache.felix.framework.util.ThreadGate)\r\n\tat org.apache.felix.framework.util.ThreadGate.await(ThreadGate.java:79)\r\n\t- locked <0x000000075b17b250> (a org.apache.felix.framework.util.ThreadGate)\r\n\tat org.apache.felix.framework.Felix.waitForStop(Felix.java:1073)\r\n\tat aQute.launcher.Launcher$2.run(Launcher.java:670)\r\n\r\n\"FelixFrameworkWiring\" #15 daemon prio=5 os_prio=0 tid=0x00007f55c41bd000 nid=0x65f5 in Object.wait() [0x00007f559a9c1000]\r\n   java.lang.Thread.State: WAITING (on object monitor)\r\n\tat java.lang.Object.wait(Native Method)\r\n\t- waiting on <0x000000075aff6650> (a java.util.ArrayList)\r\n\tat java.lang.Object.wait(Object.java:502)\r\n\tat org.apache.felix.framework.FrameworkWiringImpl.run(FrameworkWiringImpl.java:172)\r\n\t- locked <0x000000075aff6650> (a java.util.ArrayList)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n\r\n\"FelixDispatchQueue\" #10 prio=5 os_prio=0 tid=0x00007f55c41e3800 nid=0x65f0 in Object.wait() [0x00007f559b1f0000]\r\n   java.lang.Thread.State: WAITING (on object monitor)\r\n\tat java.lang.Object.wait(Native Method)\r\n\t- waiting on <0x000000075aff6568> (a java.util.ArrayList)\r\n\tat java.lang.Object.wait(Object.java:502)\r\n\tat org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:1123)\r\n\t- locked <0x000000075aff6568> (a java.util.ArrayList)\r\n\tat org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:55)\r\n\tat org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:103)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n\r\n\"Timer-0\" #9 daemon prio=5 os_prio=0 tid=0x00007f55c415c800 nid=0x65ef in Object.wait() [0x00007f559b2f1000]\r\n   java.lang.Thread.State: TIMED_WAITING (on object monitor)\r\n\tat java.lang.Object.wait(Native Method)\r\n\t- waiting on <0x000000075a7e0f20> (a java.util.TaskQueue)\r\n\tat java.util.TimerThread.mainLoop(Timer.java:552)\r\n\t- locked <0x000000075a7e0f20> (a java.util.TaskQueue)\r\n\tat java.util.TimerThread.run(Timer.java:505)\r\n\r\n\"Service Thread\" #8 daemon prio=9 os_prio=0 tid=0x00007f55c40d3000 nid=0x65ed runnable [0x0000000000000000]\r\n   java.lang.Thread.State: RUNNABLE\r\n\r\n\"C1 CompilerThread2\" #7 daemon prio=9 os_prio=0 tid=0x00007f55c40ce000 nid=0x65ec waiting on condition [0x0000000000000000]\r\n   java.lang.Thread.State: RUNNABLE\r\n\r\n\"C2 CompilerThread1\" #6 daemon prio=9 os_prio=0 tid=0x00007f55c40cc800 nid=0x65eb waiting on condition [0x0000000000000000]\r\n   java.lang.Thread.State: RUNNABLE\r\n\r\n\"C2 CompilerThread0\" #5 daemon prio=9 os_prio=0 tid=0x00007f55c40bf000 nid=0x65ea waiting on condition [0x0000000000000000]\r\n   java.lang.Thread.State: RUNNABLE\r\n\r\n\"Signal Dispatcher\" #4 daemon prio=9 os_prio=0 tid=0x00007f55c40bd000 nid=0x65e9 runnable [0x0000000000000000]\r\n   java.lang.Thread.State: RUNNABLE\r\n\r\n\"Finalizer\" #3 daemon prio=8 os_prio=0 tid=0x00007f55c4093000 nid=0x65e8 in Object.wait() [0x00007f559b9f8000]\r\n   java.lang.Thread.State: WAITING (on object monitor)\r\n\tat java.lang.Object.wait(Native Method)\r\n\t- waiting on <0x000000075a708e98> (a java.lang.ref.ReferenceQueue$Lock)\r\n\tat java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)\r\n\t- locked <0x000000075a708e98> (a java.lang.ref.ReferenceQueue$Lock)\r\n\tat java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)\r\n\tat java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)\r\n\r\n\"Reference Handler\" #2 daemon prio=10 os_prio=0 tid=0x00007f55c408e800 nid=0x65e7 in Object.wait() [0x00007f559baf9000]\r\n   java.lang.Thread.State: WAITING (on object monitor)\r\n\tat java.lang.Object.wait(Native Method)\r\n\t- waiting on <0x000000075a706b40> (a java.lang.ref.Reference$Lock)\r\n\tat java.lang.Object.wait(Object.java:502)\r\n\tat java.lang.ref.Reference.tryHandlePending(Reference.java:191)\r\n\t- locked <0x000000075a706b40> (a java.lang.ref.Reference$Lock)\r\n\tat java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)\r\n\r\n\"main\" #1 prio=5 os_prio=0 tid=0x00007f55c4009800 nid=0x65df in Object.wait() [0x00007f55cb0f0000]\r\n   java.lang.Thread.State: WAITING (on object monitor)\r\n\tat java.lang.Object.wait(Native Method)\r\n\t- waiting on <0x000000075bedfbe8> (a java.util.Vector)\r\n\tat java.lang.Object.wait(Object.java:502)\r\n\tat aQute.junit.Activator.automatic(Activator.java:193)\r\n\t- locked <0x000000075bedfbe8> (a java.util.Vector)\r\n\tat aQute.junit.Activator.run(Activator.java:142)\r\n\tat aQute.launcher.Launcher$5.call(Launcher.java:1198)\r\n\tat aQute.launcher.Launcher$5.call(Launcher.java:1196)\r\n\tat aQute.launcher.Launcher.run(Launcher.java:278)\r\n\tat aQute.launcher.Launcher.main(Launcher.java:87)\r\n\r\n\"VM Thread\" os_prio=0 tid=0x00007f55c4084800 nid=0x65e6 runnable \r\n\r\n\"GC task thread#0 (ParallelGC)\" os_prio=0 tid=0x00007f55c401e000 nid=0x65e2 runnable \r\n\r\n\"GC task thread#1 (ParallelGC)\" os_prio=0 tid=0x00007f55c4020000 nid=0x65e3 runnable \r\n\r\n\"GC task thread#2 (ParallelGC)\" os_prio=0 tid=0x00007f55c4021800 nid=0x65e4 runnable \r\n\r\n\"GC task thread#3 (ParallelGC)\" os_prio=0 tid=0x00007f55c4023800 nid=0x65e5 runnable \r\n\r\n\"VM Periodic Task Thread\" os_prio=0 tid=0x00007f55c40d5800 nid=0x65ee waiting on condition \r\n\r\nJNI global references: 43\r\n\r\n```\r\n\r\nI'm filing this bug in this repo just because I found the [source of the template containing ExampleIntegrationTest here](https://github.com/bndtools/bndtools/search?utf8=%E2%9C%93&q=ExampleIntegrationTest); the root cause of this problem may lay elsewhere, of course."}}
{"actor":{"display_login":"bjhargrave"}}