8000 Fix test_importlib.test_side_effect_import() (GH-104840) · miss-islington/cpython@b407380 · GitHub
[go: up one dir, main page]

Skip to content

Commit b407380

Browse files
vstinnermiss-islington
authored andcommitted
Fix test_importlib.test_side_effect_import() (pythonGH-104840)
Wait until the thread spawn by the import completes to avoid dangling threads. With this fix, the following command no longer fails: ./python -m test --fail-env-changed test_importlib -m test_side_effect_import -F -j20 (cherry picked from commit 4269509) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 6d00ae3 commit b407380

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_importlib/test_threaded_import.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ def target():
244244
self.addCleanup(forget, TESTFN)
245245
self.addCleanup(rmtree, '__pycache__')
246246
importlib.invalidate_caches()
247-
__import__(TESTFN)
247+
with threading_helper.wait_threads_exit():
248+
__import__(TESTFN)
248249
del sys.modules[TESTFN]
249250

250251
def test_concurrent_futures_circular_import(self):

0 commit comments

Comments
 (0)
0