Add test coverage for concurrent set.pop() calls
Author: CaQtimlCreated Sep 24, 2026Updated Sep 28, 2026
Labelsteststopic-free-threading
This test aims for a free-threaded Python.
Testcases in Lib/test/test_free_threading/test_set.py do not cover a case where several threads pop from the same set. So, I want to add a test where .pop is called by several threads on the same set.
My test checks whether the original items are returned exactly once (no duplicates) and the popped set ends up empty.
This is my first time contributing to CPython, so I welcome any advice! I will create a PR soon.
Linked PRs
- gh-158107
Source: python/cpython