Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor tweaks: unshard test_tools, shard on -j 2
  • Loading branch information
gpshead committed Nov 22, 2022
commit 09b830ea6867f6bd44502bbd0de41be6160a9074
2 changes: 1 addition & 1 deletion Lib/test/libregrtest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self):
self.tests_to_shard.add('test_concurrent_futures')
self.tests_to_shard.add('test_multiprocessing_spawn')
self.tests_to_shard.add('test_asyncio')
self.tests_to_shard.add('test_tools')
# Only 1 long test case #self.tests_to_shard.add('test_tools')
self.tests_to_shard.add('test_multiprocessing_forkserver')
self.tests_to_shard.add('test_multiprocessing_fork')
self.tests_to_shard.add('test_signal')
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/libregrtest/runtest_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def _run_process(self, test_name: str, tmp_dir: str, stdout_fh: TextIO,
self.start_time = time.monotonic()

if shard:
self.current_test_name = f'{test_name}-shard-{shard.number:02}/{shard.total_shards-1:02}'
self.current_test_name = f'{test_name}-subset:{shard.number}/{shard.total_shards}'
else:
self.current_test_name = test_name
try:
Expand Down Expand Up @@ -437,10 +437,10 @@ def __init__(self, regrtest: Regrtest) -> None:
self.output: queue.Queue[QueueOutput] = queue.Queue()
tests_and_shards = []
for test in self.regrtest.tests:
if self.num_procs > 2 and test in self.regrtest.tests_to_shard:
if self.num_procs > 1 and test in self.regrtest.tests_to_shard:
# Split shardable tests across multiple processes to run
# distinct subsets of tests within a given test module.
shards = min(self.num_procs//2+1, 8) # avoid diminishing returns
shards = min(self.num_procs*2//3+1, 10) # diminishing returns
for shard_no in range(shards):
tests_and_shards.append((test, ShardInfo(shard_no, shards)))
else:
Expand Down