]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109917: Fix test instability in test_concurrent_futures (#110306)
authorelfstrom <elfstrom@users.noreply.github.com>
Tue, 3 Oct 2023 21:59:49 +0000 (23:59 +0200)
committerGitHub <noreply@github.com>
Tue, 3 Oct 2023 21:59:49 +0000 (22:59 +0100)
commita376a72bd92cd7c9930467dd1aba40045fb75e3b
treeafbdd4bb2cb85e4f63c3cfdfbccd04948589f9e3
parent4467d2c3ac728f21af02594df5f151f29422c3a5
gh-109917: Fix test instability in test_concurrent_futures (#110306)

The test had an instability issue due to the ordering of the dummy
queue operation and the real wakeup pipe operations. Both primitives
are thread safe but not done atomically as a single update and may
interleave arbitrarily. With the old order of operations this can lead
to an incorrect state where the dummy queue is full but the wakeup
pipe is empty. By swapping the order in clear() I think this can no
longer happen in any possible operation interleaving (famous last
words).
Lib/test/test_concurrent_futures/test_deadlock.py