Skip to content

Instantly share code, notes, and snippets.

@lptr
Created July 10, 2023 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lptr/0c3712a76b95d5f81d7d2ada1a4c0042 to your computer and use it in GitHub Desktop.
Save lptr/0c3712a76b95d5f81d7d2ada1a4c0042 to your computer and use it in GitHub Desktop.
diff --git a/subprojects/workers/src/integTest/groovy/org/gradle/workers/internal/WorkerExecutorNestingIntegrationTest.groovy b/subprojects/workers/src/integTest/groovy/org/gradle/workers/internal/WorkerExecutorNestingIntegrationTest.groovy
index 4bafe3023e0..125b582e331 100644
--- a/subprojects/workers/src/integTest/groovy/org/gradle/workers/internal/WorkerExecutorNestingIntegrationTest.groovy
+++ b/subprojects/workers/src/integTest/groovy/org/gradle/workers/internal/WorkerExecutorNestingIntegrationTest.groovy
@@ -146,14 +146,12 @@ class WorkerExecutorNestingIntegrationTest extends AbstractWorkerExecutorIntegra
buildFile << """
${getWorkActionWithNesting("noIsolation", "noIsolation")}
- class WorkerExecutorThreads {
static def getWorkerExecutorThreads() {
def threadGroup = Thread.currentThread().threadGroup
def threads = new Thread[threadGroup.activeCount()]
threadGroup.enumerate(threads)
return threads.findAll { it?.name?.startsWith("${WorkerExecutionQueueFactory.QUEUE_DISPLAY_NAME}") }
}
- }
task runInWorker(type: NestingWorkerTask) {
submissions = ${maxWorkers * 2}
@@ -165,13 +163,13 @@ class WorkerExecutorNestingIntegrationTest extends AbstractWorkerExecutorIntegra
// Let the keep-alive time on the thread pool expire
sleep(${DefaultConditionalExecutionQueue.KEEP_ALIVE_TIME_MS})
- def executorThreads = WorkerExecutorThreads.getWorkerExecutorThreads()
+ def executorThreads = getWorkerExecutorThreads()
while(System.currentTimeMillis() < timeout) {
if (executorThreads.size() <= ${maxWorkers}) {
break
}
sleep 100
- executorThreads = WorkerExecutorThreads.getWorkerExecutorThreads()
+ executorThreads = getWorkerExecutorThreads()
}
println "\\nWorker Executor threads:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment