File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -628,11 +628,16 @@ def create_temp_dir(self):
628
628
# Define a writable temp dir that will be used as cwd while running
629
629
# the tests. The name of the dir includes the pid to allow parallel
630
630
# testing (see the -j option).
631
- pid = os .getpid ()
631
+ # Emscripten and WASI have stubbed getpid(), Emscripten has only
632
+ # milisecond clock resolution. Use randint() instead.
633
+ if sys .platform in {"emscripten" , "wasi" }:
634
+ nounce = random .randint (0 , 1_000_000 )
635
+ else :
636
+ nounce = os .getpid ()
632
637
if self .worker_test_name is not None :
633
- test_cwd = 'test_python_worker_{}' .format (pid )
638
+ test_cwd = 'test_python_worker_{}' .format (nounce )
634
639
else :
635
- test_cwd = 'test_python_{}' .format (pid )
640
+ test_cwd = 'test_python_{}' .format (nounce )
636
641
test_cwd += os_helper .FS_NONASCII
637
642
test_cwd = os .path .join (self .tmp_dir , test_cwd )
638
643
return test_cwd
Original file line number Diff line number Diff line change @@ -63,9 +63,9 @@ def main(regrtest_args):
63
63
args .append ('-n' ) # Silence alerts under Windows
64
64
if not any (is_multiprocess_flag (arg ) for arg in regrtest_args ):
65
65
if cross_compile and hostrunner :
66
- # For now use only one core for cross-compiled builds;
66
+ # For now use only two cores for cross-compiled builds;
67
67
# hostrunner can be expensive.
68
- args .extend (['-j' , '1 ' ])
68
+ args .extend (['-j' , '2 ' ])
69
69
else :
70
70
args .extend (['-j' , '0' ]) # Use all CPU cores
71
71
if not any (is_resource_use_flag (arg ) for arg in regrtest_args ):
You can’t perform that action at this time.
0 commit comments