File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1593,6 +1593,28 @@ def task():
15931593 self .assertEqual (os .read (r_interp , 1 ), FINI )
15941594 self .assertEqual (os .read (r_interp , 1 ), DONE )
15951595
1596+ @cpython_only
1597+ @unittest .skipIf (True , "only crashes some of the time now that Py_EndInterpreter() can handle more threads" )
1598+ def test_daemon_threads_fatal_error (self ):
1599+ import_module ("_testcapi" )
1600+ subinterp_code = f"""if 1:
1601+ import os
1602+ import threading
1603+ import time
1604+
1605+ def f():
1606+ # Make sure the daemon thread is still running when
1607+ # Py_EndInterpreter is called.
1608+ time.sleep({ test .support .SHORT_TIMEOUT } )
1609+ threading.Thread(target=f, daemon=True).start()
1610+ """
1611+ script = r"""if 1:
1612+ import _testcapi
1613+
1614+ _testcapi.run_in_subinterp(%r)
1615+ """ % (subinterp_code ,)
1616+ assert_python_ok ("-c" , script )
1617+
15961618 def _check_allowed (self , before_start = '' , * ,
15971619 allowed = True ,
15981620 daemon_allowed = True ,
You can’t perform that action at this time.
0 commit comments