Skip to content

Commit 04fd2e9

Browse files
committed
GH-112536: Add more TSan tests
These may all exercise some non-trivial aspects of thread synchronization.
1 parent 1a33513 commit 04fd2e9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Lib/test/libregrtest/tsan.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# chosen because they use threads and run in a reasonable amount of time.
33

44
TSAN_TESTS = [
5+
'test_asyncio',
6+
# TODO: enable more of test_capi once bugs are fixed (GH-116908, GH-116909).
7+
'test_capi.test_mem',
8+
'test_capi.test_pyatomic',
59
'test_code',
610
'test_enum',
711
'test_functools',
@@ -11,6 +15,9 @@
1115
'test_io',
1216
'test_logging',
1317
'test_queue',
18+
'test_signal',
19+
'test_socket',
20+
'test_sqlite3',
1421
'test_ssl',
1522
'test_syslog',
1623
'test_thread',

Modules/_testinternalcapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,8 @@ check_pyobject_forbidden_bytes_is_freed(PyObject *self,
12871287
static PyObject *
12881288
check_pyobject_freed_is_freed(PyObject *self, PyObject *Py_UNUSED(args))
12891289
{
1290-
/* This test would fail if run with the address sanitizer */
1291-
#ifdef _Py_ADDRESS_SANITIZER
1290+
/* ASan or TSan would report an use-after-free error */
1291+
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
12921292
Py_RETURN_NONE;
12931293
#else
12941294
PyObject *op = PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type);

0 commit comments

Comments
 (0)