java.lang.UnsupportedOperationException: Cannot nest operations in the same thread. Each nested operation must run in its own thread.

Bug #1755607 reported by Andreas Schildbach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gradle (Ubuntu)
New
Undecided
Unassigned

Bug Description

In the test phase of several of my projects, I get an exception repeated many times (one for each test?). I tested manually installed gradles too and the issue is present on 3.2.1 too but seems fixed in 3.3.

Cannot nest operations in the same thread. Each nested operation must run in its own thread.
java.lang.UnsupportedOperationException: Cannot nest operations in the same thread. Each nested operation must run in its own thread.
        at org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry.doStartOperation(DefaultBuildOperationWorkerRegistry.java:65)
        at org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry.access$400(DefaultBuildOperationWorkerRegistry.java:30)
        at org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry$DefaultOperation.operationStart(DefaultBuildOperationWorkerRegistry.java:163)
        at org.gradle.api.internal.tasks.testing.worker.ForkingTestClassProcessor.processTestClass(ForkingTestClassProcessor.java:68)
        at org.gradle.api.internal.tasks.testing.processors.RestartEveryNTestClassProcessor.processTestClass(RestartEveryNTestClassProcessor.java:47)
        at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:29)
        at org.gradle.internal.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:132)
        at org.gradle.internal.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33)
        at org.gradle.internal.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:72)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gradle 3.2.1-5
ProcVersionSignature: Ubuntu 4.15.0-10.11-generic 4.15.3
Uname: Linux 4.15.0-10-generic x86_64
ApportVersion: 2.20.8-0ubuntu10
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Tue Mar 13 23:17:26 2018
InstallationDate: Installed on 2013-01-11 (1887 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gradle
UpgradeStatus: Upgraded to bionic on 2018-03-07 (6 days ago)

Revision history for this message
Andreas Schildbach (schildbach) wrote :
Revision history for this message
Andreas Schildbach (schildbach) wrote :

I worked around this problem by manually installing the junit package (3.8.2-9). Note that the gradle package transitively declares a dependency to junit4, but seems to strictly require JUnit 3.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.