mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.11] Fix test_importlib.test_side_effect_import() (GH-104840) (#104843)
Fix test_importlib.test_side_effect_import() (GH-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 426950993f
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
3b3f2e107b
commit
76873ca6b1
1 changed files with 2 additions and 1 deletions
|
@ -244,7 +244,8 @@ class ThreadedImportTests(unittest.TestCase):
|
|||
self.addCleanup(forget, TESTFN)
|
||||
self.addCleanup(rmtree, '__pycache__')
|
||||
importlib.invalidate_caches()
|
||||
__import__(TESTFN)
|
||||
with threading_helper.wait_threads_exit():
|
||||
__import__(TESTFN)
|
||||
del sys.modules[TESTFN]
|
||||
|
||||
def test_concurrent_futures_circular_import(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue