Repository navigation
Fix flaky test_no_reconnect[--no-nanny] - #5686
Merged
jcrist merged 4 commits intoJan 27, 2022
Merged
Conversation
Collaborator
|
Can one of the admins verify this patch? |
test_no_reconnect[--no-nanny]
test_no_reconnect[--no-nanny]test_no_reconnect[--no-nanny]
Member
|
@graingert is there anything you wanted to add here? If not we're good to merge |
fjetter
reviewed
Jan 25, 2022
| print(out.decode()) | ||
|
|
||
|
|
||
| def wait_for_port(address, timeout=5): |
Member
There was a problem hiding this comment.
I have no idea if anybody is using this but imho this should not be part of our public API
graingert
marked this pull request as ready for review
January 25, 2022 12:16
Member
Author
there's nothing else other than what we want to do with |
jcrist
approved these changes
Jan 26, 2022
| from asyncio import to_thread | ||
| else: | ||
|
|
||
| async def to_thread(*func_args, **kwargs): |
Member
There was a problem hiding this comment.
I could see this being useful elsewhere, and it feels a bit odd to inline it in the test file. Perhaps move it to distributed.utils instead?
there's a chance wait_for_workers will return before the worker notices the connection was aborted
graingert
force-pushed
the
fix-flakey-test-no-reconnect-no-nanny
branch
from
January 27, 2022 13:20
efd1142 to
5b7597c
Compare
graingert
force-pushed
the
fix-flakey-test-no-reconnect-no-nanny
branch
from
January 27, 2022 13:32
5b7597c to
bc8d31c
Compare
Member
|
The macos tests seem slow lately on GHA. Since this passed before, going to skip them and merge as is. Thanks @graingert! |
gjoseph92
pushed a commit
to gjoseph92/distributed
that referenced
this pull request
Feb 1, 2022
* Fix flakey `test_no_reconnect[--no-nanny]` (dask#5680) * remove unused `wait_for_port` * avoid wait_for_workers in test_reconnect there's a chance wait_for_workers will return before the worker notices the connection was aborted * make `utils_test.terminate_process` private
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.
pre-commit run --all-fileswhen investigating this flakey test on tmux I found that
distributed.utils_test.wait_for_portwas consuming 100% cpu in a tight loop aroundsocket.create_connection, delaying the startup of the worker process longer than 5 seconds. I worked around this by running theSchedulerin the test directly.this PR also restores the original purpose of the test:
test_no_reconnectwas originally added here:2c2a33f#diff-f23384aa58b61650a9a8b7986f731bc77294f89c9e65187fbfea0dace6692008R44-R51
the purpose of the test appears to be to see if once the connection to the scheduler is interrupted the worker process should terminate on its own, however in d1edbac#diff-f23384aa58b61650a9a8b7986f731bc77294f89c9e65187fbfea0dace6692008R51 when the worker and scheduler context managers were swapped, however the
while is_alive(worker)check was moved outside thepopen(['dask-worker', ...context manager which terminates the process anyway.