]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-116631: Fix race condition in `test_shutdown_immediate_put_join` (#116670)
authorSam Gross <colesbury@gmail.com>
Wed, 13 Mar 2024 18:56:28 +0000 (14:56 -0400)
committerGitHub <noreply@github.com>
Wed, 13 Mar 2024 18:56:28 +0000 (14:56 -0400)
commit98ab21cce6d4c7bd2b5a0a1521b50b1ce2566a44
tree6f41df0b53447c065c838b2214ef8b7487ebb2e4
parent25684e71310642ffd20b45eea9b5226a1fa809a5
gh-116631: Fix race condition in `test_shutdown_immediate_put_join` (#116670)

The test case had a race condition: if `q.task_done()` was executed
after `shutdown(immediate=True)`, then it would raise an exception
because the immediate shutdown already emptied the queue. This happened
rarely with the GIL (due to the switching interval), but frequently in
the free-threaded build.
Lib/test/test_queue.py