FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.11] gh-113205: test_multiprocessing.test_terminate: Test the API on threadpools (GH-114186) by miss-islington · Pull Request #114223 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 9 additions & 1 deletion Lib/test/_test_multiprocessing.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2693,8 +2693,16 @@ def test_make_pool(self):

def test_terminate(self):
# Simulate slow tasks which take "forever" to complete
sleep_time = support.LONG_TIMEOUT

if self.TYPE == 'threads':
# Thread pool workers can't be forced to quit, so if the first
# task starts early enough, we will end up waiting for it.
# Sleep for a shorter time, so the test doesn't block.
sleep_time = 1

p = self.Pool(3)
args = [support.LONG_TIMEOUT for i in range(10_000)]
args = [sleep_time for i in range(10_000)]
result = p.map_async(time.sleep, args, chunksize=1)
p.terminate()
p.join()
Expand Down

Back | FazBrowse Home | New Git URL