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

Refactor dask tests #2377

Merged
merged 27 commits into from
Jun 14, 2021
Merged

Refactor dask tests #2377

merged 27 commits into from
Jun 14, 2021

Conversation

freddyaboulton
Copy link
Contributor

@freddyaboulton freddyaboulton commented Jun 11, 2021

Pull Request Description

Refactor dask tests to not reuse a client across tests. Also use the "standard" pytest workflow of writing functions instead of classes. This was inspired by how lightgbm tests dask.

https://github.com/microsoft/LightGBM/pull/4159/files

I pushed a commit every three hours over the weekend and the tests always passed. Note the following:

  1. A lot of the red x's are because the codecov/patch check did not pass (I believe this is a "bug" stemming from the fact there was no diff over repeated commits. The issue fixed itself though).

  2. This does not fix this issue Flaky Dask test #2341, and it's why the windows unit tests failed for commit 5d57ebb. However, dask_sends_woodwork_schema did not fail.

I still do not have a 100% confident explanation of what was causing the original error. But I don't think this was a gh problem after all since I was finally able to repro the timeout locally.

My hand-wavy explanation is that the dask scheduler somehow is losing track of the data we've scattered. Since the client is the scheduler and we're reusing the same client across the test, it made me think that some global state was being corrupted. I saw that lightgbm and xgboost do not reuse clients across tests and it gave me the idea to try it here.

I filed an issue with dask/distributed as well dask/distributed#4907


After creating the pull request: in order to pass the release_notes_updated check you will need to update the "Future Release" section of docs/source/release_notes.rst to include this pull request by adding :pr:123.

@codecov
Copy link

codecov bot commented Jun 11, 2021

Codecov Report

Merging #2377 (ac97755) into main (5169f4b) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2377     +/-   ##
=======================================
+ Coverage   99.9%   99.9%   +0.1%     
=======================================
  Files        281     281             
  Lines      24849   24858      +9     
=======================================
+ Hits       24817   24826      +9     
  Misses        32      32             
Impacted Files Coverage Δ
evalml/tests/automl_tests/test_automl_dask.py 100.0% <100.0%> (ø)
evalml/tests/automl_tests/test_dask_engine.py 100.0% <100.0%> (ø)
evalml/tests/conftest.py 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5169f4b...ac97755. Read the comment docs.

@freddyaboulton freddyaboulton marked this pull request as ready for review June 14, 2021 15:16
Copy link
Contributor

@angela97lin angela97lin left a comment

Choose a reason for hiding this comment

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

LGTM, I like this refactor a lot and it aligns more with how our other unit tests work too. And of course, the almost-consistently green CI makes me happy 😁

@@ -7,6 +7,7 @@ Release Notes
* Documentation Changes
* Testing Changes
* Add ``pytest-timeout``. All tests that run longer than 6 minutes will fail. :pr:`2374`
* Refactored dask tests :pr:`2377`
Copy link
Contributor

Choose a reason for hiding this comment

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

omega nit-pick but maybe include why so that when we try to trace this back in the future we know? :P

@chukarsten
Copy link
Contributor

We should probably standby for a little bit to see whether turning off the broadcast option helps, like in PR #2376. I've been tracking some of the speculation and resolution on the source issue, #2354 . The dask issue that led me to try turning off broadcast was here. I'd be hesitant to move away from the single client for testing only because it should work that way, haha.

Copy link
Contributor

@bchen1116 bchen1116 left a comment

Choose a reason for hiding this comment

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

Nice changes!

@freddyaboulton freddyaboulton merged commit 0277fba into main Jun 14, 2021
@freddyaboulton freddyaboulton deleted the refactor-dask-tests branch June 14, 2021 17:38
This was referenced Jun 17, 2021
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.

4 participants