summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/test_locks.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-109974: Fix threading lock_tests race conditions (#110057) (#110346)Victor Stinner2023-10-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gh-109974: Fix threading lock_tests race conditions (#110057) Fix race conditions in test_threading lock tests. Wait until a condition is met rather than using time.sleep() with a hardcoded number of seconds. * Replace sleeping loops with support.sleeping_retry() which raises an exception on timeout. * Add wait_threads_blocked(nthread) which computes a sleep depending on the number of threads. Remove _wait() function. * test_set_and_clear(): use a way longer Event.wait() timeout. * BarrierTests.test_repr(): wait until the 2 threads are waiting for the barrier. Use a way longer timeout for Barrier.wait() timeout. * test_thread_leak() no longer needs to count len(threading.enumerate()): Bunch uses threading_helper.wait_threads_exit() internally which does it in wait_for_finished(). * Add BaseLockTests.wait_phase() which implements a timeout. test_reacquire() and test_recursion_count() use wait_phase(). (cherry picked from commit 4e356ad183eeb567783f4a87fd092573da1e9252) * gh-109974: Fix more threading lock_tests race conditions (#110089) * Add context manager on Bunch class. * Bunch now catchs exceptions on executed functions and re-raise them at __exit__() as an ExceptionGroup. * Rewrite BarrierProxy.test_default_timeout(). Use a single thread. Only check that barrier.wait() blocks for at least default timeout seconds. * test_with(): inline _with() function. (cherry picked from commit 743e3572ee940a6cf88fd518e5f4a447905ba5eb)
* [3.12] gh-109593: Fix reentrancy issue in multiprocessing resource_tracker ↵Miss Islington (bot)2023-10-021-0/+2
| | | | | | | | | | | | (GH-109629) (#109898) gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629) --------- (cherry picked from commit 0eb98837b60bc58e57ad3e2b35c6b0e9ab634678) Co-authored-by: Antoine Pitrou <antoine@python.org> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-101766: Fix refleak for _BlockingOnManager resources from test suite ↵Dong-hee Na2023-02-171-0/+5
| | | | level (gh-101988)
* bpo-40280: Detect missing threading on WASM platforms (GH-32352)Christian Heimes2022-04-071-1/+4
| | | Co-authored-by: Brett Cannon <brett@python.org>
* bpo-46425: fix direct invocation of `test_importlib` (GH-30682)Nikita Sobolev2022-01-221-1/+1
|
* bpo-45229: Remove test_main in many tests (GH-28405)Serhiy Storchaka2021-09-191-9/+5
| | | | | | | | | Instead of explicitly enumerate test classes for run_unittest() use the unittest ability to discover tests. This also makes these tests discoverable and runnable with unittest. load_tests() can be used for dynamic generating tests and adding doctests. setUpModule(), tearDownModule() and addModuleCleanup() can be used for running code before and after all module tests.
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-1/+2
|
* bpo-35202: Remove unused imports in tests. (GH-10561)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-161-1/+0
|
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-122/+100
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Issue #26940: Fix test_importlib that hangs on the Android armv7 qemu emulator.Xavier de Gaye2016-12-081-1/+1
|
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-1/+0
|
* Issue #21755: Skip {Frozen,Source}_DeadlockAvoidanceTests tests whenBerker Peksag2014-07-031-66/+78
| | | | Python is built without threads.
* Issue 21137: Better repr for threading.Lock()Raymond Hettinger2014-05-261-0/+3
|
* Issue #21503: Use test_both() consistently in test_importlib.Eric Snow2014-05-161-21/+26
|
* Fix test to not consider mixin a standalone testBrett Cannon2013-10-181-1/+1
|
* Issue #16803: Have test_importlib.test_locks use frozen and sourceBrett Cannon2013-10-181-21/+48
| | | | code.
* Issue #15794: Relax a test case due to the deadlock detection's ↵Antoine Pitrou2012-08-281-4/+18
| | | | conservativeness.
* Issue #15168: Move importlb.test to test.test_importlib.Brett Cannon2012-07-201-0/+115
This should make the Linux distros happy as it is now easier to leave importlib's tests out of their base Python distribution.