Skip to content

Commit 17883a6

Browse files
committed
.
1 parent 3847ea8 commit 17883a6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

libs/javalib/src/mill/javalib/TestModuleUtil.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ final class TestModuleUtil(
205205
val claimFolder = base / "claim"
206206
os.makeDir.all(claimFolder)
207207

208+
// Make sure we can claim at least one test class to start before we spawn the
209+
// subprocess, because creating JVM subprocesses are expensive and we don't want
210+
// to spawn one if there is nothing for it to do
208211
val startingTestClass = os
209212
.list
210213
.stream(testClassQueueFolder)
@@ -213,13 +216,13 @@ final class TestModuleUtil(
213216

214217
if (force || startingTestClass.nonEmpty) {
215218
startingTestClass.foreach(logger.ticker(_))
216-
// queue.log file will be appended by the runner with the stolen test class's name
219+
// claim.log file will be appended by the runner with the stolen test class's name
217220
// it can be used to check the order of test classes of the runner
218-
val claimLog = claimFolder / os.up / s"${claimFolder.last}.log"
221+
val claimLog = claimFolder / "../claim.log"
219222
os.write.over(claimLog, Array.empty[Byte])
220223
workerStatusMap.put(claimLog, logger.ticker)
221224
// test runner will log success/failure test class counter here while running
222-
val resultPath = base / s"result.log"
225+
val resultPath = base / "result.log"
223226
os.write.over(resultPath, upickle.default.write((0L, 0L)))
224227
workerResultSet.put(resultPath, ())
225228

0 commit comments

Comments
 (0)