Skip to content

Commit b18aaf5

Browse files
edsavagecursoragent
andcommitted
[ML] Revert test parallelism to -j 2 for low-core machines
Using numCpus-1 (i.e. -j 3 on 4 cores) caused CPU contention on macOS Orka VMs, slowing timing-sensitive tests. Revert to -j 2 for machines with <=4 cores — the proven safe value. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 71a7f09 commit b18aaf5

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ project.ext.numCpus = Runtime.runtime.availableProcessors()
115115
// many suites simultaneously causes resource contention. These values were
116116
// determined empirically (see PR #2900).
117117
// On low-core machines (<=4, e.g. macOS CI Orka VMs with 4 cores),
118-
// cap at numCpus-1 to leave headroom for timing-sensitive tests
119-
// (e.g. CKMostCorrelatedTest/testScale). For higher core counts,
120-
// ceil(numCpus/2) balances parallelism vs contention — ceil(numCpus/3)
121-
// was too conservative on 8-core machines (52 min vs 39.5 min).
122-
project.ext.testParallel = isWindows ? 2 : (numCpus <= 4 ? Math.max(2, numCpus - 1) : Math.max(2, (int) Math.ceil(numCpus / 2.0)))
118+
// use 2 to avoid starving timing-sensitive tests like
119+
// CKMostCorrelatedTest/testScale. For higher core counts,
120+
// ceil(numCpus/2) balances parallelism vs contention.
121+
project.ext.testParallel = isWindows ? 2 : (numCpus <= 4 ? 2 : Math.max(2, (int) Math.ceil(numCpus / 2.0)))
123122
project.ext.makeEnvironment = [ 'CPP_CROSS_COMPILE': cppCrossCompile,
124123
'VERSION_QUALIFIER': versionQualifier,
125124
'SNAPSHOT': (isSnapshot ? 'yes' : 'no'),

0 commit comments

Comments
 (0)