https://github.com/python/cpython/commit/f0cf88c65937e9deee0a48778de62c1d7234a1b4 commit: f0cf88c65937e9deee0a48778de62c1d7234a1b4 branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: vstinner <[email protected]> date: 2026-11-17T21:26:12Z summary:
[3.15] gh-162144: Skip `@nomemtest` tests when using a thread sanitizer (TSan) (GH-162154) (#162174) gh-162144: Skip `@nomemtest` tests when using a thread sanitizer (TSan) (GH-162154) (cherry picked from commit e28063ef9bc5c79ab8576a7293ec97e5bd62b37a) Co-authored-by: Victor Stinner <[email protected]> files: A Misc/NEWS.d/next/Tests/2026-11-17-15-57-41.gh-issue-162144.pL5k29.rst M Lib/test/support/__init__.py diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 389215153385b58..12faf32d1373d3e 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1330,7 +1330,13 @@ def internal(*args, **kwargs): import_module('_testcapi') return test(*args, **kwargs) - return cpython_only(internal) + # gh-162144: set_nomemory() and call_with_nomemory() of _testcapi are not + # thread safe and emit warnings when using a thread sanitizer (TSan). + use_tsan = check_sanitizer(thread=True) + reason ='not working with thread sanitizer (gh-157415)' + skip_if_tsan = unittest.skipIf(use_tsan, reason) + + return cpython_only(skip_if_tsan(internal)) def bigaddrspacetest(f): """Decorator for tests that fill the address space.""" diff --git a/Misc/NEWS.d/next/Tests/2026-11-17-15-57-41.gh-issue-162144.pL5k29.rst b/Misc/NEWS.d/next/Tests/2026-11-17-15-57-41.gh-issue-162144.pL5k29.rst new file mode 100644 index 000000000000000..bbd4a9cf54752e0 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-11-17-15-57-41.gh-issue-162144.pL5k29.rst @@ -0,0 +1,3 @@ +Skip ``@support.nomemtest`` tests when using a thread sanitizer (TSan). +``set_nomemory()`` and ``call_with_nomemory()`` functions of the +:mod:`!_testcapi` extension are not thread safe. Patch by Victor Stinner. _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
