mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
![]() [3.12] gh-109974: Fix threading lock_tests race conditions (#110057) (#110346) * 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 |
||
---|---|---|
.. | ||
builtin | ||
data | ||
data01 | ||
data02 | ||
data03 | ||
extension | ||
frozen | ||
import_ | ||
namespace_pkgs | ||
namespacedata01 | ||
partial | ||
resources | ||
source | ||
zipdata01 | ||
zipdata02 | ||
__init__.py | ||
__main__.py | ||
abc.py | ||
fixtures.py | ||
stubs.py | ||
test_abc.py | ||
test_api.py | ||
test_compatibilty_files.py | ||
test_contents.py | ||
test_files.py | ||
test_lazy.py | ||
test_locks.py | ||
test_main.py | ||
test_metadata_api.py | ||
test_namespace_pkgs.py | ||
test_open.py | ||
test_path.py | ||
test_pkg_import.py | ||
test_read.py | ||
test_reader.py | ||
test_resource.py | ||
test_spec.py | ||
test_threaded_import.py | ||
test_util.py | ||
test_windows.py | ||
test_zip.py | ||
threaded_import_hangers.py | ||
update-zips.py | ||
util.py |