Skip to content

Commit 1ee3dd2

Browse files
kz930claude
andcommitted
build(verify): bound the pool the operator sweep runs in
OperatorBehaviorSpec forks a Python subprocess per operator, and at core-count concurrency the contention caused rare flakes. A fixed 4 is deterministic across machines and still runs about three times faster than serial; it also matches PythonWorkerPool's own default cap, so the two bounds agree rather than multiply. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent f66d6e5 commit 1ee3dd2

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

‎workflow-compiling-service/build.sbt‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,27 @@ ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
4141
// Manage dependency conflicts by always using the latest revision
4242
ThisBuild / conflictManager := ConflictManager.latestRevision
4343

44-
// Restrict parallel execution of tests to avoid conflicts
44+
// Restrict parallel execution of tests to avoid conflicts. This caps how many
45+
// test *suites* run concurrently; ParallelTestExecution still parallelizes the
46+
// tests *within* a suite (e.g. OperatorBehaviorSpec) via ScalaTest's own pool.
4547
Global / concurrentRestrictions += Tags.limit(Tags.Test, 1)
4648

49+
// -P4 bounds ScalaTest's ParallelTestExecution pool, and only this module wants
50+
// it: OperatorBehaviorSpec forks a Python subprocess per operator, and at
51+
// core-count concurrency (e.g. 12) resource contention caused rare flakes. A
52+
// fixed 4 stays deterministic across machines (incl. CI runners) while still
53+
// running ~3x faster than serial, and it matches PythonWorkerPool's own default
54+
// worker cap so the two bounds agree rather than multiply. Unconditional, so a
55+
// local run reproduces the concurrency CI runs at instead of a faster one that
56+
// flakes differently; WCS_TEST_FILTER selects which tests run, which is a
57+
// separate question from how many run at once. The fast-unit job is unaffected
58+
// either way, since OperatorBehaviorSpec is the only spec here that
59+
// parallelizes and that job excludes it. It lives here rather than in the
60+
// shared helper so that helper stays identical for every module. sbt
61+
// concatenates the ScalaTest arguments of every testOptions entry, so this
62+
// lands in the same argument list as the -n the split adds.
63+
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-P4")
64+
4765
/////////////////////////////////////////////////////////////////////////////
4866
// Compiler Options
4967
/////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)