Skip to content

Commit

Permalink
pythongh-109974: Enhance threading lock_tests
Browse files Browse the repository at this point in the history
* Replace sleeping loops with support.sleeping_retry() which raises
  an exception after a timeout.
* test_set_and_clear(): increase event wait()
  timeout. Remove sleep after Bunch.wait_for_started().
* BarrierTests.test_repr(): remove sleep after wait_for_started().
  Wait until the 2 threads are waiting for the barrier.
  Use long 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().
  • Loading branch information
vstinner committed Sep 28, 2023
1 parent f580edc commit d8f4003
Showing 1 changed file with 155 additions and 85 deletions.

0 comments on commit d8f4003

Please sign in to comment.