From 4e4b81c49925ce0f68682b7e261ee149e50009ce Mon Sep 17 00:00:00 2001 From: kary zheng Date: Wed, 2 Sep 2026 16:33:41 -0700 Subject: [PATCH] build: read the fork options once, outside the grouping loop sbt lifts a `.value` written inside a lambda to the top of the task, so the options were already read once rather than per suite. Written where it was, it read as the other thing, and sbt warned on it in every build of the repository. Co-Authored-By: Claude Opus 5 (1M context) --- build.sbt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 035edbb68cc..394aefa10cd 100644 --- a/build.sbt +++ b/build.sbt @@ -227,8 +227,14 @@ lazy val FileService = (project in file("file-service")) Test / fork := true, Test / forkOptions := (Test / forkOptions).value .withWorkingDirectory((ThisBuild / baseDirectory).value), - Test / testGrouping := (Test / definedTests).value.map { suite => - Tests.Group(suite.name, Seq(suite), Tests.SubProcess((Test / forkOptions).value)) + Test / testGrouping := { + // Read once, outside the loop: sbt lifts a `.value` written inside a lambda to + // the top of the task anyway, so leaving it there reads as one lookup per suite + // when it is not, and sbt warns about exactly that. + val forked = (Test / forkOptions).value + (Test / definedTests).value.map { suite => + Tests.Group(suite.name, Seq(suite), Tests.SubProcess(forked)) + } } )