summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Do not retain references to processes and managers in TestSyncManagerTypes ↵Pablo Galindo2019-02-091-0/+2
| | | | | (GH-11801) Keeping references to processes and managers between tests makes them count as dangling processes.
* bpo-35917: Test multiprocessing manager classes and shareable types (GH-11772)Giampaolo Rodola2019-02-071-0/+246
| | | | multiprocessing: provide unittests for manager classes and shareable types
* bpo-35424: emit ResourceWarning at multiprocessing.Pool destruction (GH-10974)Victor Stinner2018-12-201-0/+16
| | | | multiprocessing.Pool destructor now emits ResourceWarning if the pool is still running.
* bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)Victor Stinner2018-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).
* bpo-35477: multiprocessing.Pool.__enter__() fails if called twice (GH-11134)Victor Stinner2018-12-131-0/+16
| | | | multiprocessing.Pool.__enter__() now fails if the pool is not running: "with pool:" fails if used more than once.
* bpo-35424: test_multiprocessing: join 3 pools (GH-10986)Victor Stinner2018-12-061-0/+3
| | | | | | Join 3 pools in these tests: * test.test_multiprocessing_spawn.WithProcessesTestPool.test_context * test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback
* Revert "bpo-34172: multiprocessing.Pool leaks resources after being deleted ↵Victor Stinner2018-12-061-7/+0
| | | | | (GH-8450)" (GH-10971) This reverts commit 97bfe8d3ebb0a54c8798f57555cb4152f9b2e1d0.
* bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)Victor Stinner2018-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.
* bpo-35202: Remove unused imports in Lib directory (GH-10450)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-151-1/+0
|
* bpo-19675: Terminate processes if construction of a pool is failing. (GH-5614)Julien Palard2018-11-041-0/+43
|
* bpo-22872: multiprocessing.Queue's put() and get() now raise ValueError if ↵Zackery Spytz2018-10-131-0/+8
| | | | | | | the queue is closed. (GH-9010) Previously, put() and get() would raise AssertionError and OSError, respectively.
* bpo-33613: Fix test_semaphore_tracker signal tests when using -Werror (GH-9778)Pablo Galindo2018-10-101-2/+4
| | | | | | Tests involving sending signals to the semaphore_tracker will not fail anymore due to the fact that running the test suite with -Werror propagates warnings as errors. Fix a missing assertion when the semaphore_tracker is expected to die.
* bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450)tzickel2018-10-021-0/+6
| | | Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly.
* bpo-31370: Remove references to threadless builds (#8805)Zackery Spytz2018-09-291-3/+0
| | | Support for threadless builds was removed in a6a4dc81.
* bpo-34610: Fixed iterator of multiprocessing.managers.DictProxy. (GH-9113)Serhiy Storchaka2018-09-171-0/+23
|
* bpo-33613, test_semaphore_tracker_sigint: fix race condition (#7850)Pablo Galindo2018-09-041-6/+21
| | | | | | | | | | | | Fail `test_semaphore_tracker_sigint` if no warnings are expected and one is received. Fix race condition when the child receives SIGINT before it can register signal handlers for it. The race condition occurs when the parent calls `_semaphore_tracker.ensure_running()` (which in turn spawns the semaphore_tracker using `_posixsubprocess.fork_exec`), the child registers the signal handlers and the parent tries to kill the child. What seem to happen is that in some slow systems, the parent sends the signal to kill the child before the child protects against the signal.
* bpo-30317: Fix multiprocessing test_timeout() (GH-8621)Victor Stinner2018-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.
* Simplify __all__ in multiprocessing (GH-6856)Derek B. Kim2018-07-111-0/+6
|
* bpo-34040, multiprocessing: Fix test_forkserver_sigkill() (GH-8081)Victor Stinner2018-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.
* bpo-33735: Fix test_multiprocessing random failure (GH-8059)Victor Stinner2018-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()
* bpo-33715: Fix multiprocessing test_wait_result() (GH-7971)Victor Stinner2018-06-271-2/+2
| | | Increase timeouts from 10 seconds to 1 minute.
* bpo-30356: Fix test_mymanager_context() of multiprocessing (GH-7968)Victor Stinner2018-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.
* bpo-30317, test_multiprocessing: fix test_timeout() (GH-7957)Victor Stinner2018-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
* Revert "bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)" (GH-7919)Victor Stinner2018-06-261-5/+7
| | | This reverts commit 8fbbdf0c3107c3052659e166f73990b466eacbb0.
* bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)Victor Stinner2018-06-221-7/+5
| | | | | | | | * Add support.MS_WINDOWS: True if Python is running on Microsoft Windows. * Add support.MACOS: True if Python is running on Apple macOS. * Replace support.is_android with support.ANDROID * Replace support.is_jython with support.JYTHON * Cleanup code to initialize unix_shell
* bpo-33532: Fix test_multiprocessing_forkserver.test_ignore() (GH-7319)Victor Stinner2018-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.
* bpo-33532: Fix multiprocessing test_ignore() (#7262)Victor Stinner2018-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.
* Spelling fixes to docs, docstrings, and comments (GH-6374)Ville Skyttä2018-04-201-1/+1
|
* bpo-32759: Free unused arenas in multiprocessing.heap (GH-5827)Antoine Pitrou2018-04-091-23/+58
| | | | | Large shared arrays allocated using multiprocessing would remain allocated until the process ends.
* FIX failure on OSX sem_getvalue (#6180)Thomas Moreau2018-03-211-2/+7
|
* bpo-33078 - Fix queue size on pickling error (GH-6119)Thomas Moreau2018-03-211-0/+13
|
* bpo-31804: Fix multiprocessing.Process with broken standard streams (#6079)Antoine Pitrou2018-03-111-2/+29
| | | | | 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.
* 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).