Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc200757

Browse files
authored
gh-84461: Fix parallel testing on WebAssembly (GH-93768)
1 parent443ca73 commitc200757

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

‎Lib/test/libregrtest/main.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,16 @@ def create_temp_dir(self):
628628
# Define a writable temp dir that will be used as cwd while running
629629
# the tests. The name of the dir includes the pid to allow parallel
630630
# 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+
ifsys.platformin {"emscripten","wasi"}:
634+
nounce=random.randint(0,1_000_000)
635+
else:
636+
nounce=os.getpid()
632637
ifself.worker_test_nameisnotNone:
633-
test_cwd='test_python_worker_{}'.format(pid)
638+
test_cwd='test_python_worker_{}'.format(nounce)
634639
else:
635-
test_cwd='test_python_{}'.format(pid)
640+
test_cwd='test_python_{}'.format(nounce)
636641
test_cwd+=os_helper.FS_NONASCII
637642
test_cwd=os.path.join(self.tmp_dir,test_cwd)
638643
returntest_cwd

‎Tools/scripts/run_tests.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def main(regrtest_args):
6363
args.append('-n')# Silence alerts under Windows
6464
ifnotany(is_multiprocess_flag(arg)forarginregrtest_args):
6565
ifcross_compileandhostrunner:
66-
# For now use onlyone core for cross-compiled builds;
66+
# For now use onlytwo cores for cross-compiled builds;
6767
# hostrunner can be expensive.
68-
args.extend(['-j','1'])
68+
args.extend(['-j','2'])
6969
else:
7070
args.extend(['-j','0'])# Use all CPU cores
7171
ifnotany(is_resource_use_flag(arg)forarginregrtest_args):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp