File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Lib/test/test_interpreters Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
from test import support
9
9
from test .support import import_helper
10
+ from test .support .script_helper import assert_python_ok
10
11
# Raise SkipTest if subinterpreters not supported.
11
12
_interpreters = import_helper .import_module ('_interpreters' )
12
13
from test .support import Py_GIL_DISABLED
@@ -675,6 +676,13 @@ def task():
675
676
self .assertEqual (os .read (r_interp , 1 ), FINISHED )
676
677
677
678
def test_remaining_daemon_threads (self ):
679
+ # Daemon threads leak reference by nature, because they hang threads
680
+ # without allowing them to do cleanup (i.e., release refs).
681
+ # To prevent that from messing up the refleak hunter and whatnot, we
682
+ # run this in a subprocess.
683
+ code = '''if True:
684
+ import _interpreters
685
+ import types
678
686
interp = _interpreters.create(
679
687
types.SimpleNamespace(
680
688
use_main_obmalloc=False,
@@ -698,6 +706,8 @@ def task():
698
706
t.start()
699
707
""")
700
708
_interpreters.destroy(interp)
709
+ '''
710
+ assert_python_ok ('-c' , code )
701
711
702
712
703
713
class TestInterpreterPrepareMain (TestBase ):
You can’t perform that action at this time.
0 commit comments