summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866)Pablo Galindo2020-03-091-0/+13
|
* bpo-35727: Use exit code 0 on sys.exit() in multiprocessing.Process. (GH-11538)Christopher Hunt2020-02-211-6/+15
|
* bpo-38546: multiprocessing tests stop the resource tracker (GH-17641)Victor Stinner2019-12-171-10/+1
| | | | | | | | | | Multiprocessing and concurrent.futures tests now stop the resource tracker process when tests complete. Add ResourceTracker._stop() method to multiprocessing.resource_tracker. Add _cleanup_tests() helper function to multiprocessing.util: share code between multiprocessing and concurrent.futures tests.
* bpo-38614: Use support timeout constants (GH-17572)HEADmasterVictor Stinner2019-12-111-4/+3
|
* bpo-38614: Use test.support.SHORT_TIMEOUT constant (GH-17566)Victor Stinner2019-12-111-1/+1
| | | | | | | | | | | | | | | Replace hardcoded timeout constants in tests with SHORT_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once. SHORT_TIMEOUT is 30 seconds by default, but it can be longer depending on --timeout command line option. The change makes almost all timeouts longer, except test_reap_children() of test_support which is made 2x shorter: SHORT_TIMEOUT should be enough. If this test starts to fail, LONG_TIMEOUT should be used instead. Uniformize also "from test import support" import in some test files.
* bpo-38614: Use test.support.LONG_TIMEOUT constant (GH-17562)Victor Stinner2019-12-101-2/+2
| | | | | | | | Replace hardcoded timeout constants in tests with LONG_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once. LONG_TIMEOUT is 5 minutes by default, but it can be longer depending on --timeout command line option.
* bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088)Jake Tesler2019-11-191-0/+22
| | | | | | | | | | | | | | | | | | | This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`. In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own). This change forces the Process object to update its `native_id` attribute during the bootstrap process. cc @vstinner https://bugs.python.org/issue38707 Automerge-Triggered-By: @pitrou
* bpo-38614: Add timeout constants to test.support (GH-16964)Victor Stinner2019-10-301-12/+6
| | | | | | | | Add timeout constants to test.support: * LOOPBACK_TIMEOUT * INTERNET_TIMEOUT * SHORT_TIMEOUT * LONG_TIMEOUT
* bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)Victor Stinner2019-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.
* bpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)Victor Stinner2019-09-241-2/+1
| | | | Multiprocessing tests: increase test_queue_feeder_donot_stop_onexc() timeout from 1 to 60 seconds.
* bpo-38018: Fix test for multiprocessing.shared_memory in BSD systems (GH-15821)Vinay Sharma2019-09-101-2/+7
|
* bpo-38018: Increase code coverage for multiprocessing.shared_memory (GH-15662)Vinay Sharma2019-09-091-0/+24
|
* bpo-37558: Shared memory tests are failing due to double slashes (GH-14703)Jakub Kulík2019-07-111-1/+1
| | | | | | With the addition of shared memory into Python 3.8, we now have three tests failing on Solaris, namely `test_multiprocessing_fork`, `test_multiprocessing_forkserver` and `test_multiprocessing_spawn`. The reason seems to be incorrect name handling which results in two slashes being prepended. https://bugs.python.org/issue37558
* bpo-37421: multiprocessing tests now stop ForkServer (GH-14601)Victor Stinner2019-07-051-0/+6
| | | | | multiprocessing tests now stop the ForkServer instance if it's running: close the "alive" file descriptor to ask the server to stop and then remove its UNIX address.
* bpo-37421: multiprocessing tests call _run_finalizers() (GH-14527)Victor Stinner2019-07-021-0/+3
| | | | | multiprocessing tests now call explicitly _run_finalizers() to remove immediately temporary directories created by multiprocessing.util.get_temp_dir().
* bpo-37244: Fix test_multiprocessing.test_resource_tracker() (GH-14288)Pierre Glaser2019-06-251-6/+15
| | | Increase robustness of test_resource_tracker(): retry for 60 seconds.
* bpo-36888, test_multiprocessing: Increase test_parent_process timeout (GH-14286)Pierre Glaser2019-06-251-3/+3
|
* bpo-36888: Add multiprocessing.parent_process() (GH-13247)Thomas Moreau2019-05-201-0/+59
|
* bpo-36867: _test_multiprocessing: avoid weak sync primitive (GH-13292)Pierre Glaser2019-05-171-4/+12
| | | Avoid weak sync primitive in multiprocessing resource_tracker test.
* bpo-36867: Create the resource_tracker before launching SharedMemoryManagers ↵Pierre Glaser2019-05-131-14/+44
| | | | (GH-13276)
* bpo-36867: Make semaphore_tracker track other system resources (GH-13222)Pierre Glaser2019-05-101-54/+116
| | | The multiprocessing.resource_tracker replaces the multiprocessing.semaphore_tracker module. Other than semaphores, resource_tracker also tracks shared_memory segments. Patch by Pierre Glaser.
* bpo-36368: Ignore SIGINT in SharedMemoryManager servers. (GH-12483)Pierre Glaser2019-05-101-0/+24
| | | | Fix a bug crashing SharedMemoryManager instances in interactive sessions after a Ctrl-C (KeyboardInterrupt) was sent.
* bpo-36668: FIX reuse semaphore tracker for child processes (#5172)Thomas Moreau2019-04-241-0/+28
| | | Fix the multiprocessing.semaphore_tracker so it is reused by child processes.
* bpo-35934: Add socket.create_server() utility function (GH-11784)Giampaolo Rodola2019-04-081-6/+2
|
* Raise the timeout in test_multiprocessing_* for slow buildbots (GH-12489)Pablo Galindo2019-03-221-1/+1
|
* bpo-35813: Tests and docs for shared_memory (#11816)Davin Potts2019-02-241-33/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added tests for shared_memory submodule. * Added tests for ShareableList. * Fix bug in allocationn size during creation of empty ShareableList illuminated by existing test run on Linux. * Initial set of docs for shared_memory module. * Added docs for ShareableList, added doctree entry for shared_memory submodule, name refactoring for greater clarity. * Added examples to SharedMemoryManager docs, for ease of documentation switched away from exclusively registered functions to some explicit methods on SharedMemoryManager. * Wording tweaks to docs. * Fix test failures on Windows. * Added tests around SharedMemoryManager. * Documentation tweaks. * Fix inappropriate test on Windows. * Further documentation tweaks. * Fix bare exception. * Removed __copyright__. * Fixed typo in doc, removed comment. * Updated SharedMemoryManager preliminary tests to reflect change of not supporting all registered functions on SyncManager. * Added Sphinx doctest run controls. * CloseHandle should be in a finally block in case MapViewOfFile fails. * Missed opportunity to use with statement. * Switch to self.addCleanup to spare long try/finally blocks and save one indentation, change to use decorator to skip test instead. * Simplify the posixshmem extension module. Provide shm_open() and shm_unlink() functions. Move other functionality into the shared_memory.py module. * Added to doc around size parameter of SharedMemory. * Changed PosixSharedMemory.size to use os.fstat. * Change SharedMemory.buf to a read-only property as well as NamedSharedMemory.size. * Marked as provisional per PEP411 in docstring. * Changed SharedMemoryTracker to be private. * Removed registered Proxy Objects from SharedMemoryManager. * Removed shareable_wrap(). * Removed shareable_wrap() and dangling references to it. * For consistency added __reduce__ to key classes. * Fix for potential race condition on Windows for O_CREX. * Remove unused imports. * Update access to kernel32 on Windows per feedback from eryksun. * Moved kernel32 calls to _winapi. * Removed ShareableList.copy as redundant. * Changes to _winapi use from eryksun feedback. * Adopt simpler SharedMemory API, collapsing PosixSharedMemory and WindowsNamedSharedMemory into one. * Fix missing docstring on class, add test for ignoring size when attaching. * Moved SharedMemoryManager to managers module, tweak to fragile test. * Tweak to exception in OpenFileMapping suggested by eryksun. * Mark a few dangling bits as private as suggested by Giampaolo.
* bpo-35918: Remove broken has_key method and add test (#11819)Rémi Lapeyre2019-02-121-2/+0
|
* bpo-35378: Fix multiprocessing.Pool references (GH-11627)Pablo Galindo2019-02-111-1/+0
| | | | | | | | | Changes in this commit: 1. Use a _strong_ reference between the Pool and associated iterators 2. Rework PR #8450 to eliminate a cycle in the Pool. There is no test in this commit because any test that automatically tests this behaviour needs to eliminate the pool before joining the pool to check that the pool object is garbaged collected/does not hang. But doing this will potentially leak threads and processes (see https://bugs.python.org/issue35413).
* Make sure the BaseManager in test_multiprocessing is cleaned up correctly ↵Pablo Galindo2019-02-091-15/+20
| | | | (GH-11653)
* 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.