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

use the loop fixture in more tests #6642

Merged
merged 3 commits into from
Jul 5, 2022

Conversation

graingert
Copy link
Member

Refs #6163

This allows us to make sure the tornado loop is cleaned up after interacting with LoopRunner

  • avoid loop fixture in test_basic_no_loop

this test intentionally passes loop=None and currently results
in a "No running loop" deprecation warning

  • split test_client_loop tests into two

@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2022

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

       15 files  ±0         15 suites  ±0   6h 15m 28s ⏱️ - 26m 24s
  2 909 tests ±0    2 824 ✔️ +2    79 💤 ±0  6  - 1 
21 540 runs   - 1  20 597 ✔️  - 2  935 💤 +2  8 ±0 

For more details on these failures, see this check.

Results for commit a3c663c. ± Comparison against base commit 7b24c94.

♻️ This comment has been updated with latest results.

@graingert graingert force-pushed the use-the-loop-fixture-for-more-tests branch from 338e321 to 58b7a13 Compare July 4, 2022 10:13
* avoid loop fixture in test_basic_no_loop

this test intentionally passes loop=None and currently results
in a "No running loop" deprecation warning

* split test_client_loop tests into two
@graingert graingert force-pushed the use-the-loop-fixture-for-more-tests branch from 58b7a13 to 72a1e6b Compare July 4, 2022 13:11
@graingert graingert force-pushed the use-the-loop-fixture-for-more-tests branch from 72a1e6b to a3c663c Compare July 4, 2022 14:13
):
pass
def test_repeated(loop_in_thread):
loop = loop_in_thread
Copy link
Collaborator

Choose a reason for hiding this comment

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

What makes you need loop_in_thread instead of just loop?

Copy link
Member Author

Choose a reason for hiding this comment

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

the LocalCluster.__exit__ closes the loop that's passed in - unless it's already running in another thread

pass
sleep(0.1)
with Client(s["address"]) as c:
with Client(s["address"], loop=None) as c:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand the purpose of this test?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Everything LGTM with the exception of this.
It makes little sense to me - particularly after comparing it to the async test directly above.
Maybe the omission of the explicit loop may have just been a mistake from the previous developer?

Copy link
Member Author

@graingert graingert Jul 4, 2022

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

it's explicitly testing the case where the Client is started up without a loop, so to make this intention clear I pass loop=None

@crusaderky crusaderky merged commit 1a6ea8c into dask:main Jul 5, 2022
@crusaderky
Copy link
Collaborator

Thank you

@graingert graingert deleted the use-the-loop-fixture-for-more-tests branch July 5, 2022 08:33
graingert added a commit to graingert/distributed that referenced this pull request Jul 5, 2022
Refs dask#6163
follow up to dask#6642
adjustments for tests added since the first round, and addition
of explicit loop=None for cases where the LoopRunner itself
is being tested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants