summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)Miss Islington (bot)2019-09-241-5/+6
| | | | | | | | | | | Multiprocessing test test_mymanager() now also expects -SIGTERM, not only exitcode 0. bpo-30356: BaseManager._finalize_manager() sends SIGTERM to the manager process if it takes longer than 1 second to stop, which happens on slow buildbots. (cherry picked from commit b0e1ae5f5430433766e023c1a6936aeba0f2b84e) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)Miss Islington (bot)2019-09-241-2/+1
| | | | | | | Multiprocessing tests: increase test_queue_feeder_donot_stop_onexc() timeout from 1 to 60 seconds. (cherry picked from commit 99799c722065d0524f3ab0bc455e1938bb8dc60f) Co-authored-by: Victor Stinner <vstinner@python.org>
* Raise the timeout in test_multiprocessing_* for slow buildbots (GH-12489)Miss Islington (bot)2019-03-221-1/+1
| | | | | (cherry picked from commit 40b6907b377cfc8c4743007894364ac8c5a1c113) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-35918: Remove broken has_key method and add test (GH-11819) (#11824)Miss Islington (bot)2019-02-121-2/+0
| | | | | (cherry picked from commit a31f4cc881992e84d351957bd9ac1a92f882fa39) Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
* Make sure the BaseManager in test_multiprocessing is cleaned up correctly ↵Miss Islington (bot)2019-02-091-15/+20
| | | | | | | (GH-11653) (cherry picked from commit 7b2a37b728b37e7da6d3f48c24c93a9dd0daa0fc) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* Do not retain references to processes and managers in TestSyncManagerTypes ↵Miss Islington (bot)2019-02-091-0/+2
| | | | | | | | (GH-11801) Keeping references to processes and managers between tests makes them count as dangling processes. (cherry picked from commit 613f729e5ddd201765a9a04efc1c76decb3a19c4) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.7] bpo-35917: Test multiprocessing manager classes and shareable types ↵Antoine Pitrou2019-02-071-0/+236
| | | | | | | | (GH-11772) (GH-11780) multiprocessing: provide unittests for manager classes and shareable types. (cherry picked from commit 2848d9d29914948621bce26bf0d9a89f2e19b97b) Co-authored-by: Giampaolo Rodola <g.rodola@gmail.com>
* bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)Miss Islington (bot)2018-12-171-20/+20
| | | | | | | | | | Replace time.time() with time.monotonic() in tests to measure time delta. test_zipfile64: display progress every minute (60 secs) rather than every 5 minutes (5*60 seconds). (cherry picked from commit 2cf4c202ffeb30787c944365ba54013688b854c2) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-35424: test_multiprocessing: join 3 pools (GH-10986)Miss Islington (bot)2018-12-061-0/+3
| | | | | | | | | Join 3 pools in these tests: * test.test_multiprocessing_spawn.WithProcessesTestPool.test_context * test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback (cherry picked from commit 388c8c208d9d09bd28289c1e4776b947d4d0f0f0) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [3.7] Revert "bpo-34172: multiprocessing.Pool leaks resources after being ↵Victor Stinner2018-12-061-7/+0
| | | | | | deleted (GH-8450) (GH-9676)" (#10968) This reverts commit 97f998a4dfd6db6d867f446daa62445d0782bf39.
* bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)Miss Islington (bot)2018-11-281-0/+2
| | | | | | | | | | Fix WithThreadsTestPool.test_wrapped_exception() of test_multiprocessing_fork: join the pool. WithThreadsTestPool.test_del_pool() is now also decorated with @support.reap_threads. (cherry picked from commit b7278736b3ae158a7738057e3045bc767ced019e) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-34172: multiprocessing.Pool leaks resources after being deleted ↵Miss Islington (bot)2018-10-021-0/+6
| | | | | | | | (GH-8450) (GH-9676) Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. (cherry picked from commit 97bfe8d3ebb0a54c8798f57555cb4152f9b2e1d0) Co-authored-by: tzickel <tzickel@users.noreply.github.com>
* bpo-34610: Fixed iterator of multiprocessing.managers.DictProxy. (GH-9113)Miss Islington (bot)2018-09-171-0/+23
| | | | | (cherry picked from commit e0e5065daef36dafe10a46eaa8b7800274d73062) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-30317: Fix multiprocessing test_timeout() (GH-8621)Miss Islington (bot)2018-08-031-3/+4
| | | | | | | | Multiprocessing test_timeout() now accepts a delta of 100 ms instead of just 50 ms, since the test failed with 135.8 ms instead of the expected 200 ms. (cherry picked from commit 5640d030e100aade54210034828b711c3b506b18) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-34040, multiprocessing: Fix test_forkserver_sigkill() (GH-8081)Miss Islington (bot)2018-07-041-2/+6
| | | | | | | | | | | Fix test_forkserver_sigkill() of test_multiprocessing_forkserver: give more time to the first child process to complete, double the sleep in the parent process. Reduce also the child process sleep from 1000 ms to 500 ms, to not change the total duration of the test. (cherry picked from commit 07888e1cce89e9bb7dc501e287b4cb126e01c378) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-33735: Fix test_multiprocessing random failure (GH-8059)Miss Islington (bot)2018-07-031-3/+3
| | | | | | | | | | | | | | | When hunting memory leaks using -R 3:3, test_imap_unordered() of test_multiprocessing leaks randomly a few memory blocks. It is a false alarm: when testing using -R 3:20 for example, no leak is detected. Modify test_imap_unordered() to be closer to test_imap(): * Only test 10 numbers instead of 1000: it's a pool of 4 processes, so 10 is enough to test at least one number per process * Use chunksize=100 instead of chunksize=53 to mimick test_imap() (cherry picked from commit 23401fb960bb94e6ea62d2999527968d53d3fc65) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-33715: Fix multiprocessing test_wait_result() (GH-7971)Miss Islington (bot)2018-06-271-2/+2
| | | | | | Increase timeouts from 10 seconds to 1 minute. (cherry picked from commit 492572715aa0f4ddab51f979f7f56465c762227c) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-30356: Fix test_mymanager_context() of multiprocessing (GH-7968)Miss Islington (bot)2018-06-271-1/+3
| | | | | | | | test_mymanager_context() now also accepts -SIGTERM as an expected exitcode for the manager process. The process is killed with SIGTERM if it takes longer than 1 second to stop. (cherry picked from commit fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-30317, test_multiprocessing: fix test_timeout() (GH-7957)Miss Islington (bot)2018-06-271-2/+2
| | | | | | | | | | | | | | Tolerate a different of 50 ms, instead of just 30 ms, in test_timeout() of multiprocessing tests. This change should fix such test failure on Windows: FAIL: test_timeout (test.test_multiprocessing_spawn.WithProcessesTestQueue) Traceback (most recent call last): File "lib\test\_test_multiprocessing.py", line 753, in test_timeout self.assertGreaterEqual(delta, 0.170) AssertionError: 0.16138982772827148 not greater than or equal to 0.17 (cherry picked from commit f15f66d275d1166839312c9ff3a67c00b486c7d6) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-33532: Fix test_multiprocessing_forkserver.test_ignore() (GH-7319)Miss Islington (bot)2018-06-011-2/+5
| | | | | | | Use also support.SOCK_MAX_SIZE, not only support.PIPE_MAX_SIZE, to get the size for a blocking send into a multiprocessing pipe. (cherry picked from commit 252f6abe0a9430f4ae7588c0cb50a6ff141bebe3) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-33532: Fix multiprocessing test_ignore() (GH-7262)Miss Islington (bot)2018-05-311-2/+2
| | | | | | | | Fix test_ignore() of multiprocessing tests like test_multiprocessing_forkserver: use support.PIPE_MAX_SIZE to make sure that send_bytes() blocks. (cherry picked from commit 5d6c7ed5e340b2311a15f34e968d4bef09c71922) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* Spelling fixes to docs, docstrings, and comments (GH-6374)Miss Islington (bot)2018-04-201-1/+1
| | | | | (cherry picked from commit 61f82e0e337f971da57f8f513abfe693edf95aa5) Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
* FIX failure on OSX sem_getvalue (GH-6180) (GH-6181)Miss Islington (bot)2018-03-211-2/+7
| | | | | (cherry picked from commit dec1c7786f642049c2508e909442189dc043b5da) Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
* bpo-33078 - Fix queue size on pickling error (GH-6119) (GH-6178)Miss Islington (bot)2018-03-211-0/+13
| | | | | (cherry picked from commit e2f33add635df4fde81be9960bab367e010c19bf) Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
* bpo-31804: Fix multiprocessing.Process with broken standard streams ↵Miss Islington (bot)2018-03-111-2/+29
| | | | | | | | | | (GH-6079) (GH-6080) In some conditions the standard streams will be None or closed in the child process (for example if using "pythonw" instead of "python" on Windows). Avoid failing with a non-0 exit code in those conditions. Report and initial patch by poxthegreat. (cherry picked from commit e756f66c83786ee82f5f7d45931ae50a6931dd7f) Co-authored-by: Antoine Pitrou <pitrou@free.fr>
* bpo-28134: Auto-detect socket values from file descriptor (#1349)Christian Heimes2018-01-291-1/+1
| | | | | | | | | | | | | | | Fix socket(fileno=fd) by auto-detecting the socket's family, type, and proto from the file descriptor. The auto-detection can be overruled by passing in family, type, and proto explicitly. Without the fix, all socket except for TCP/IP over IPv4 are basically broken: >>> s = socket.create_connection(('www.python.org', 443)) >>> s <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('2003:58:bc4a:3b00:56ee:75ff:fe47:ca7b', 59730, 0, 0), raddr=('2a04:4e42:1b::223', 443, 0, 0)> >>> socket.socket(fileno=s.fileno()) <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('2003:58:bc4a:3b00::%2550471192', 59730, 0, 2550471192), raddr=('2a04:4e42:1b:0:700c:e70b:ff7f:0%2550471192', 443, 0, 2550471192)> Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31699 Deadlocks in `concurrent.futures.ProcessPoolExecutor` with ↵Thomas Moreau2018-01-051-0/+37
| | | | | | pickling error (#3895) Fix deadlocks in :class:`concurrent.futures.ProcessPoolExecutor` when task arguments or results cause pickling or unpickling errors. This should make sure that calls to the :class:`ProcessPoolExecutor` API always eventually return.
* bpo-32294: Fix multiprocessing test_semaphore_tracker() (#4885)Victor Stinner2017-12-151-1/+1
| | | | Run the child process with -E option to ignore the PYTHONWARNINGS environment variable.
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-081-1/+1
| | | | | | | | | | | kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
* bpo-31310: multiprocessing's semaphore tracker should be launched again if ↵Antoine Pitrou2017-11-031-4/+39
| | | | | | | | | | | crashed (#3247) * bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed * Avoid mucking with process state in test. Add a warning if the semaphore process died, as semaphores may then be leaked. * Add NEWS entry
* bpo-31308: If multiprocessing's forkserver dies, launch it again when ↵Antoine Pitrou2017-11-031-0/+48
| | | | | | | | | | | | | | | | | | | | | | necessary (#3246) * bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary. * Fix test on Windows * Add NEWS entry * Adopt a different approach: ignore SIGINT and SIGTERM, as in semaphore tracker. * Fix comment * Make sure the test doesn't muck with process state * Also test previously-started processes * Update 2017-08-30-17-59-36.bpo-31308.KbexyC.rst * Avoid masking SIGTERM in forkserver. It's not necessary and causes a race condition in test_many_processes.
* bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed ↵Antoine Pitrou2017-10-221-0/+21
| | | | or None. (#4073)
* bpo-31510: Fix multiprocessing test_many_processes() on macOS (#3857)Victor Stinner2017-10-021-1/+6
| | | | On macOS, a process can exit with -SIGKILL if it is killed "early" with SIGTERM.
* bpo-31234: test_multiprocessing: wait 30 seconds (#3599)Victor Stinner2017-09-151-14/+17
| | | | Give 30 seconds to join_process(), instead of 5 or 10 seconds, to wait until the process completes.
* bpo-31234: Add support.join_thread() helper (#3587)Victor Stinner2017-09-141-11/+17
| | | | join_thread() joins a thread but raises an AssertionError if the thread is still alive after timeout seconds.
* bpo-18966: non-daemonic threads created by a multiprocessing.Process should ↵Antoine Pitrou2017-08-161-0/+26
| | | | | | | | be joined on exit (#3111) * bpo-18966: non-daemonic threads created by a multiprocessing.Process should be joined on exit * Add NEWS blurb
* bpo-31069, test_multiprocessing: Fix dangling process (#3103)Victor Stinner2017-08-161-1/+2
| | | | Fix a warning about dangling processes in test_rapid_restart() of _test_multiprocessing: join the process.
* bpo-26762: _test_multiprocessing reports dangling (#3064)Victor Stinner2017-08-101-0/+6
| | | | _test_multiprocessing now marks the test as ENV_CHANGED on dangling process or thread.
* bpo-26762: test_multiprocessing close more queues (#2855)Victor Stinner2017-07-251-3/+15
| | | | | | * Close explicitly queues to make sure that we don't leave dangling threads * test_queue_in_process(): remove unused queue * test_access() joins also the process to fix a random warning
* test_multiprocessing detects dangling per test case (#2841)Victor Stinner2017-07-241-14/+67
| | | | | | | | | | | | | bpo-26762: test_multiprocessing now detects dangling processes and threads per test case classes: * setUpClass()/tearDownClass() of mixin classes now check if multiprocessing.process._dangling or threading._dangling was modified to detect "dangling" processses and threads. * ManagerMixin.tearDownClass() now also emits a warning if it still has more than one active child process after 5 seconds. * tearDownModule() now checks for dangling processes and threads before sleep 500 ms. And it now only sleeps if there is a least one dangling process or thread.
* test_multiprocessing: Fix dangling process/thread (#2850)Victor Stinner2017-07-241-2/+22
| | | | | | | bpo-26762: Fix more dangling processes and threads in test_multiprocessing: * Queue: call close() followed by join_thread() * Process: call join() or self.addCleanup(p.join)
* bpo-26762: Avoid daemon process in _test_multiprocessing (#2842)Victor Stinner2017-07-241-2/+4
| | | | | test_level() of _test_multiprocessing._TestLogging now uses regular processes rather than daemon processes to prevent zombi processes (to not "leak" processes).
* bpo-26732: fix too many fds in processes started with the "forkserver" ↵Antoine Pitrou2017-07-221-0/+34
| | | | | | | | | | method (#2813) * bpo-26732: fix too many fds in processes started with the "forkserver" method A child process would inherit as many fds as the number of still-running children. * Add blurb and test comment
* Fix test failure without ctypes (#2802)Antoine Pitrou2017-07-211-1/+1
|
* bpo-19896: Add typecodes 'q' and 'Q' to multiprocessing.sharedctypes (#2741)Gareth Rees2017-07-211-5/+12
| | | | | | | | | | * bpo-19896: Add typcodes 'q' and 'Q' to multiprocessing.sharedctypes. Patch by Antony Lee. * Add NEWS entry. * Slightly tweak NEWS entry Make it clear this is more of a fix rather than a new feature.
* bpo-30794: added kill() method to multiprocessing.Process (#2528)Vitor Pereira2017-07-181-7/+15
| | | | | | | | | | | | | | * bpo-30794: added kill() method to multiprocessing.Process * Added entries to documentation and NEWS * Refactored test_terminate and test_kill * Fix SIGTERM and SIGKILL being used on Windows for the tests * Added "versionadded" marker to the documentation * Fix trailing whitespace in doc
* bpo-29293: multiprocessing.Condition.notify() lacks parameter `n` (#2480)Antoine Pitrou2017-07-041-7/+59
| | | | | | * bpo-29293: multiprocessing.Condition.notify() lacks parameter `n` * Add NEWS blurb
* Clear potential ref cycle between Process and Process target (#2470)Antoine Pitrou2017-06-281-0/+18
| | | | | | | | | * Clear potential ref cycle between Process and Process target Besides Process.join() not being called, this was an indirect cause of bpo-30775. The threading module already does this. * Add issue reference
* bpo-30775: Fix refleaks in test_multiprocessing (#2467)Antoine Pitrou2017-06-281-2/+17
| | | Forgetting to call Process.join() can keep some resources alive.