mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.10] GH-96071: add regression test for GH-96071 (GH-96137) (#96205)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
parent
e783a23702
commit
e3c4a5b8ed
1 changed files with 14 additions and 0 deletions
|
@ -825,6 +825,20 @@ class TestThreadState(unittest.TestCase):
|
|||
t.start()
|
||||
t.join()
|
||||
|
||||
@threading_helper.reap_threads
|
||||
def test_gilstate_ensure_no_deadlock(self):
|
||||
# See https://github.com/python/cpython/issues/96071
|
||||
code = textwrap.dedent(f"""
|
||||
import _testcapi
|
||||
|
||||
def callback():
|
||||
print('callback called')
|
||||
|
||||
_testcapi._test_thread_state(callback)
|
||||
""")
|
||||
ret = assert_python_ok('-X', 'tracemalloc', '-c', code)
|
||||
self.assertIn(b'callback called', ret.out)
|
||||
|
||||
|
||||
class Test_testcapi(unittest.TestCase):
|
||||
locals().update((name, getattr(_testcapi, name))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue