Skip to content

Severe thread contention while running large test with parallel methods #772

Closed
@benlamonica

Description

@benlamonica

While running a large test (600,000+ test methods) I encountered a deadlock situation.

All of the threads are blocked with this stack trace:

pool-102-thread-8 [227] (BLOCKED)
pool-102-thread-7 [226] (BLOCKED)
pool-102-thread-6 [225] (BLOCKED)
pool-102-thread-5 [224] (BLOCKED)
pool-102-thread-4 [223] (BLOCKED)
pool-102-thread-3 [222] (BLOCKED)
pool-102-thread-2 [221] (BLOCKED)
pool-102-thread-16 [235] (BLOCKED)
pool-102-thread-15 [234] (BLOCKED)
pool-102-thread-14 [233] (BLOCKED)
pool-102-thread-13 [232] (BLOCKED)
pool-102-thread-12 [231] (BLOCKED)
pool-102-thread-11 [230] (BLOCKED)
pool-102-thread-10 [229] (BLOCKED)
pool-102-thread-1 [220] (BLOCKED)
pool-102-thread-9 [228] (BLOCKED)
   org.testng.internal.thread.graph.GraphThreadPoolExecutor.setStatus line: 85 
   org.testng.internal.thread.graph.GraphThreadPoolExecutor.afterExecute line: 94 
   java.util.concurrent.ThreadPoolExecutor.runWorker line: 1150 
   java.util.concurrent.ThreadPoolExecutor$Worker.run line: 617 
   java.lang.Thread.run line: 745 

And the thread that is holding the mutex:

pool-1-thread-1 [23] (RUNNABLE)
   java.util.HashMap$TreeNode.find line: 1865 
   java.util.HashMap$TreeNode.find line: 1861 
   java.util.HashMap$TreeNode.find line: 1861 
   java.util.HashMap$TreeNode.find line: 1861 
   java.util.HashMap$TreeNode.find line: 1861 
   java.util.HashMap$TreeNode.find line: 1861 
   java.util.HashMap$TreeNode.find line: 1861 
   java.util.HashMap$TreeNode.find line: 1861 
   java.util.HashMap$TreeNode.putTreeVal line: 1979 
   java.util.HashMap.putVal line: 637 
   java.util.HashMap.put line: 611 
   java.util.HashSet.add line: 219 
   org.testng.internal.DynamicGraph.setStatus line: 117 
   org.testng.internal.thread.graph.GraphThreadPoolExecutor.setStatus line: 86 
   org.testng.internal.thread.graph.GraphThreadPoolExecutor.runNodes line: 66 
   org.testng.internal.thread.graph.GraphThreadPoolExecutor.run line: 54 
   org.testng.TestRunner.privateRun line: 745 
   org.testng.TestRunner.run line: 621 
   org.testng.SuiteRunner.runTest line: 357 
   org.testng.SuiteRunner.runSequentially line: 352 
   org.testng.SuiteRunner.privateRun line: 310 
   org.testng.SuiteRunner.run line: 259 
   org.testng.SuiteRunnerWorker.runSuite line: 52 
   org.testng.SuiteRunnerWorker.run line: 86 
   org.testng.TestNG.runSuitesSequentially line: 1199 
   org.testng.TestNG.runSuitesLocally line: 1124 
   org.testng.TestNG.run line: 1032 
   org.apache.maven.surefire.testng.TestNGExecutor.run line: 295 
   org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute line: 84 
   org.apache.maven.surefire.testng.TestNGProvider.invoke line: 90 
   sun.reflect.NativeMethodAccessorImpl.invoke0 line: not available [native method]
   sun.reflect.NativeMethodAccessorImpl.invoke line: 62 
   sun.reflect.DelegatingMethodAccessorImpl.invoke line: 43 
   java.lang.reflect.Method.invoke line: 497 
   org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2 line: 208 
   org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke line: 155 
   org.apache.maven.surefire.booter.ProviderFactory.invokeProvider line: 81 
   org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess line: 82 
   org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider line: 974 
   org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked line: 824 
   org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute line: 722 
   org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo line: 132 
   org.apache.maven.lifecycle.internal.MojoExecutor.execute line: 208 
   org.apache.maven.lifecycle.internal.MojoExecutor.execute line: 153 
   org.apache.maven.lifecycle.internal.MojoExecutor.execute line: 145 
   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject line: 116 
   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject line: 80 
   org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build line: 51 
   org.apache.maven.lifecycle.internal.LifecycleStarter.execute line: 120 
   org.apache.maven.DefaultMaven.doExecute line: 347 
   org.apache.maven.DefaultMaven.execute line: 154 
   org.jvnet.hudson.maven3.launcher.Maven32Launcher.main line: 132 
   sun.reflect.NativeMethodAccessorImpl.invoke0 line: not available [native method]
   sun.reflect.NativeMethodAccessorImpl.invoke line: 62 
   sun.reflect.DelegatingMethodAccessorImpl.invoke line: 43 
   java.lang.reflect.Method.invoke line: 497 
   org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard line: 330 
   org.codehaus.plexus.classworlds.launcher.Launcher.launch line: 238 
   jenkins.maven3.agent.Maven32Main.launch line: 181 
   sun.reflect.NativeMethodAccessorImpl.invoke0 line: not available [native method]
   sun.reflect.NativeMethodAccessorImpl.invoke line: 62 
   sun.reflect.DelegatingMethodAccessorImpl.invoke line: 43 
   java.lang.reflect.Method.invoke line: 497 
   hudson.maven.Maven3Builder.call line: 136 
   hudson.maven.Maven3Builder.call line: 71 
   hudson.remoting.UserRequest.perform line: 118 
   hudson.remoting.UserRequest.perform line: 48 
   hudson.remoting.Request$2.run line: 326 
   hudson.remoting.InterceptingExecutorService$1.call line: 72 
   java.util.concurrent.FutureTask.run line: 266 
   java.util.concurrent.ThreadPoolExecutor.runWorker line: 1142 
   java.util.concurrent.ThreadPoolExecutor$Worker.run line: 617 
   java.lang.Thread.run line: 745 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions