TST: Join threads in test_printoptions_thread_safety#30271
Merged
seberg merged 1 commit intonumpy:mainfrom Nov 21, 2025
Merged
Conversation
The test_printoptions_thread_safety function spawned threads but exited immediately without joining them. This created a race condition where: 1. The test could return 'Passed' before the assertions inside the threads actually ran. 2. "Zombie" threads were left running in the background, potentially interfering with subsequent tests. Added .join() calls for both threads to ensure proper execution and teardown.
test_printoptions_thread_safety
Member
|
Thanks! I re-triggered the failing test runs, the failures should be unrelated. This is one reason I want to republish the |
ngoldbaum
approved these changes
Nov 21, 2025
Member
|
Makes sense, thanks @pareshjoshij and Nathan. |
Contributor
Author
|
Thanks a lot @ngoldbaum sir & @seberg sir for reviewing and merging! 🎉 |
cakedev0
pushed a commit
to cakedev0/numpy
that referenced
this pull request
Dec 5, 2025
The test_printoptions_thread_safety function spawned threads but exited immediately without joining them. This created a race condition where: 1. The test could return 'Passed' before the assertions inside the threads actually ran. 2. "Zombie" threads were left running in the background, potentially interfering with subsequent tests. Added .join() calls for both threads to ensure proper execution and teardown.
IndifferentArea
pushed a commit
to IndifferentArea/numpy
that referenced
this pull request
Dec 7, 2025
The test_printoptions_thread_safety function spawned threads but exited immediately without joining them. This created a race condition where: 1. The test could return 'Passed' before the assertions inside the threads actually ran. 2. "Zombie" threads were left running in the background, potentially interfering with subsequent tests. Added .join() calls for both threads to ensure proper execution and teardown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
test_printoptions_thread_safetyfunction spawns twothreading.Threadobjects but never calls.join()on them.This causes multiple problems:
All other threading tests in the same file already join their threads properly (via
run_threadedorThreadPoolExecutor).Fix
Add the two missing lines: