]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-130095: Mark `_py_abc` tests as not thread-safe (gh-130131)
authorSam Gross <colesbury@gmail.com>
Fri, 14 Feb 2025 21:21:45 +0000 (16:21 -0500)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2025 21:21:45 +0000 (16:21 -0500)
The `_py_abc` implementation is not currently thread-safe (even with the GIL).
Don't run these tests with `--parallel-threads=N` for now.

Lib/test/test_abc.py

index e90a8dc617c094a830054c37c0718d8e4e8c581c..80ee9e0ba56e754b70feb9a6f47fbd4820a37c8f 100644 (file)
@@ -684,10 +684,16 @@ def test_factory(abc_ABCMeta, abc_get_cache_token):
 
     return TestLegacyAPI, TestABC, TestABCWithInitSubclass
 
-TestLegacyAPI_Py, TestABC_Py, TestABCWithInitSubclass_Py = test_factory(abc.ABCMeta,
-                                                                        abc.get_cache_token)
-TestLegacyAPI_C, TestABC_C, TestABCWithInitSubclass_C = test_factory(_py_abc.ABCMeta,
-                                                                     _py_abc.get_cache_token)
+TestLegacyAPI_Py, TestABC_Py, TestABCWithInitSubclass_Py = test_factory(_py_abc.ABCMeta,
+                                                                        _py_abc.get_cache_token)
+TestLegacyAPI_C, TestABC_C, TestABCWithInitSubclass_C = test_factory(abc.ABCMeta,
+                                                                     abc.get_cache_token)
+
+# gh-130095: The _py_abc tests are not thread-safe when run with
+# `--parallel-threads`
+TestLegacyAPI_Py.__unittest_thread_unsafe__ = True
+TestABC_Py.__unittest_thread_unsafe__ = True
+TestABCWithInitSubclass_Py.__unittest_thread_unsafe__ = True
 
 if __name__ == "__main__":
     unittest.main()