Skip to content
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

test_nanny_worker_port_range hangs on Windows #5956

Merged
merged 9 commits into from
Mar 18, 2022

Conversation

crusaderky
Copy link
Collaborator

@crusaderky crusaderky commented Mar 17, 2022

@crusaderky crusaderky self-assigned this Mar 17, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2022

Unit Test Results

       12 files  +       4         12 suites  +4   7h 16m 40s ⏱️ + 4h 7m 35s
  2 666 tests +       2    2 585 ✔️ +     13    80 💤  -   10  1  - 1 
15 908 runs  +8 157  15 045 ✔️ +7 652  862 💤 +507  1  - 2 

For more details on these failures, see this check.

Results for commit 1b3e6c3. ± Comparison against base commit 2d3fddc.

♻️ This comment has been updated with latest results.

@crusaderky crusaderky marked this pull request as ready for review March 18, 2022 17:05
@crusaderky
Copy link
Collaborator Author

To clarify: this PR does not make the tests with flush_output=False robust. Several of them could start hanging if they suddenly started emitting a lot more output. It does make all other tests robust.

print("\n\nPrint from stdout\n=================\n")
print(out.decode())
if dump_stdout:
print("\n" + "-" * 27 + " Subprocess stdout/stderr" + "-" * 27)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("\n" + "-" * 27 + " Subprocess stdout/stderr" + "-" * 27)
print("\n" + "-" * 27 + " Subprocess stdout" + "-" * 27)

Are you not printing err because kwargs["stderr"] = subprocess.STDOUT means it's already been printed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are merged together because I was afraid of the subprocess getting stuck on stdout while a test is reading from stderr and vice versa.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see yes, stderr is redirected into stdout, which is then captured.

@@ -152,7 +119,8 @@ async def test_no_reconnect(c, s, nanny):
"--no-reconnect",
nanny,
"--no-dashboard",
]
],
flush_output=False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not flush_output=True here and remove the await to_thread(worker.communicate, timeout=5)? Maybe there's a subtle difference in timing I'm missing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and another test were abusing Proc.communicate to just wait for the subprocess to finish. I changed them now.

@crusaderky crusaderky merged commit ee4b099 into dask:main Mar 18, 2022
@crusaderky crusaderky deleted the test_nanny_worker_port_range branch March 18, 2022 20:20
@mrocklin
Copy link
Member

Following up here @crusaderky . Thank you for doing this PR. I'm curious, a lot of the tests that I've run into that fail unexpectedly use popen. Do you have thoughts on any additional cleanup here that might make sense? I don't have any ideas in particular, this comment is just a shot in the dark.

@mrocklin
Copy link
Member

(I found this PR through git blame)

@crusaderky
Copy link
Collaborator Author

@mrocklin see #6045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_nanny_worker_port_range hangs on Windows
3 participants