8000 [3.11] Fix test_importlib.test_side_effect_import() (GH-104840) by miss-islington · Pull Request #104843 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.11] Fix test_importlib.test_side_effect_import() (GH-104840) #104843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 4269509)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
vstinner authored and miss-islington committed May 24, 2023
commit b407380946b99a0d4941dccaf49e61f5ef1a6931
3 changes: 2 additions & 1 deletion Lib/test/test_importlib/test_threaded_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ def target():
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):
Expand Down
0