@@ -1096,7 +1096,7 @@ def run_python_unittests(python_binary, args=None, paths=None, exclude=None, env
10961096 if use_pytest :
10971097 args += ["-m" , "pytest" , "-v" , "--assert=plain" , "--tb=native" ]
10981098 else :
1099- args += [_python_test_runner (), "--durations" , "10" , "-n" , str (parallel ), f"--subprocess-args={ shlex .join (args )} " ]
1099+ args += [_python_test_runner (), "--durations" , "10" , "-n" , str (min ( os . cpu_count (), parallel ) ), f"--subprocess-args={ shlex .join (args )} " ]
11001100
11011101 if runner_args :
11021102 args += runner_args
@@ -1236,7 +1236,7 @@ def is_alive(self):
12361236
12371237
12381238def run_tagged_unittests (python_binary , env = None , cwd = None , nonZeroIsFatal = True , checkIfWithGraalPythonEE = False ,
1239- report = False , parallel = min ( os . cpu_count (), 8 ) , exclude = None , runner_args = ()):
1239+ report = False , parallel = 8 , exclude = None , runner_args = ()):
12401240 sub_env = dict (env or os .environ )
12411241 sub_env ['PYTHONPATH' ] = os .path .join (_dev_pythonhome (), 'lib-python' , '3' )
12421242
@@ -1332,30 +1332,31 @@ def graalpython_gate_runner(args, tasks):
13321332 run_python_unittests (
13331333 graalpy_standalone_jvm (),
13341334 nonZeroIsFatal = nonZeroIsFatal ,
1335- report = report ()
1335+ report = report (),
1336+ parallel = 6 ,
13361337 )
13371338
13381339 with Task ('GraalPython Python unittests with CPython' , tasks , tags = [GraalPythonTags .unittest_cpython ]) as task :
13391340 if task :
13401341 env = extend_os_env (PYTHONHASHSEED = '0' )
1341- test_args = [get_cpython (), _python_test_runner (), "-n" , "1 " , "graalpython/com.oracle.graal.python.test/src/tests" ]
1342+ test_args = [get_cpython (), _python_test_runner (), "-n" , "6 " , "graalpython/com.oracle.graal.python.test/src/tests" ]
13421343 mx .run (test_args , nonZeroIsFatal = True , env = env )
13431344
13441345 with Task ('GraalPython sandboxed tests' , tasks , tags = [GraalPythonTags .unittest_sandboxed ]) as task :
13451346 if task :
1346- run_python_unittests (graalpy_standalone_jvm_enterprise (), args = SANDBOXED_OPTIONS , report = report ())
1347+ run_python_unittests (graalpy_standalone_jvm_enterprise (), args = SANDBOXED_OPTIONS , report = report (), parallel = 6 )
13471348
13481349 with Task ('GraalPython multi-context unittests' , tasks , tags = [GraalPythonTags .unittest_multi ]) as task :
13491350 if task :
1350- run_python_unittests (graalpy_standalone_jvm (), args = ["-multi-context" ], nonZeroIsFatal = nonZeroIsFatal , report = report ())
1351+ run_python_unittests (graalpy_standalone_jvm (), args = ["-multi-context" ], nonZeroIsFatal = nonZeroIsFatal , parallel = 6 , report = report ())
13511352
13521353 with Task ('GraalPython Jython emulation tests' , tasks , tags = [GraalPythonTags .unittest_jython ]) as task :
13531354 if task :
13541355 run_python_unittests (graalpy_standalone_jvm (), args = ["--python.EmulateJython" ], paths = ["test_interop.py" ], report = report (), nonZeroIsFatal = nonZeroIsFatal )
13551356
13561357 with Task ('GraalPython with Arrow Storage Strategy' , tasks , tags = [GraalPythonTags .unittest_arrow ]) as task :
13571358 if task :
1358- run_python_unittests (graalpy_standalone_jvm (), args = ["--python.UseNativePrimitiveStorageStrategy" ], report = report (), nonZeroIsFatal = nonZeroIsFatal )
1359+ run_python_unittests (graalpy_standalone_jvm (), args = ["--python.UseNativePrimitiveStorageStrategy" ], parallel = 6 , report = report (), nonZeroIsFatal = nonZeroIsFatal )
13591360
13601361 with Task ('GraalPython HPy tests' , tasks , tags = [GraalPythonTags .unittest_hpy ]) as task :
13611362 if task :
@@ -1417,6 +1418,7 @@ def graalpython_gate_runner(args, tasks):
14171418 graalpy_standalone_jvm (),
14181419 paths = ["graalpython/com.oracle.graal.python.test/src/tests/standalone" ],
14191420 env = env ,
1421+ parallel = 3 ,
14201422 )
14211423
14221424 with Task ('GraalPython Python tests' , tasks , tags = [GraalPythonTags .tagged ]) as task :
@@ -1427,11 +1429,11 @@ def graalpython_gate_runner(args, tasks):
14271429 # Unittests on SVM
14281430 with Task ('GraalPython tests on SVM' , tasks , tags = [GraalPythonTags .svmunit , GraalPythonTags .windows ]) as task :
14291431 if task :
1430- run_python_unittests (graalpy_standalone_native (), report = report ())
1432+ run_python_unittests (graalpy_standalone_native (), parallel = 8 , report = report ())
14311433
14321434 with Task ('GraalPython sandboxed tests on SVM' , tasks , tags = [GraalPythonTags .svmunit_sandboxed ]) as task :
14331435 if task :
1434- run_python_unittests (graalpy_standalone_native_enterprise (), args = SANDBOXED_OPTIONS , report = report ())
1436+ run_python_unittests (graalpy_standalone_native_enterprise (), parallel = 8 , args = SANDBOXED_OPTIONS , report = report ())
14351437
14361438 with Task ('GraalPython license header update' , tasks , tags = [GraalPythonTags .license ]) as task :
14371439 if task :
@@ -2457,11 +2459,11 @@ def python_coverage(args):
24572459 "test_multiprocessing_graalpy" ,
24582460 ]
24592461 if kwds .pop ("tagged" , False ):
2460- run_tagged_unittests (executable , env = env , nonZeroIsFatal = False , parallel = 1 , exclude = tagged_exclude , runner_args = ['--continue-on-collection-errors' ])
2462+ run_tagged_unittests (executable , env = env , nonZeroIsFatal = False , parallel = 6 , exclude = tagged_exclude , runner_args = ['--continue-on-collection-errors' ])
24612463 elif kwds .pop ("hpy" , False ):
24622464 run_hpy_unittests (executable , env = env , nonZeroIsFatal = False , timeout = 5 * 60 * 60 ) # hpy unittests are really slow under coverage
24632465 else :
2464- run_python_unittests (executable , env = env , nonZeroIsFatal = False , timeout = 3600 , parallel = 1 , ** kwds ) # pylint: disable=unexpected-keyword-arg;
2466+ run_python_unittests (executable , env = env , nonZeroIsFatal = False , timeout = 3600 , parallel = 6 , ** kwds ) # pylint: disable=unexpected-keyword-arg;
24652467
24662468 # generate a synthetic lcov file that includes all sources with 0
24672469 # coverage. this is to ensure all sources actuall show up - otherwise,
0 commit comments