Skip to content

Conversation

@jrbourbeau
Copy link
Member

This PR adds a new initialize_test fixture which is automatically applied to each test in our test suite. This fixture does a few things:

  1. Disable custom preloads in tests, which can interact with tests in unexpected ways
  2. Ensures Dask's configuration system is reset for each test
  3. Restores default logging levels for each test

I should note that points 2 and 3 above were previously being done in our clean content manager (so all tests using gen_cluster, gen_test, or cleanup). This PR just broadens their reach to all tests.

Closes #5240

cc @mrocklin

@jrbourbeau
Copy link
Member Author

jrbourbeau commented Aug 21, 2021

The changes here have caused some tests to start failing. Interestingly if I run distributed/tests/test_client.py::test_default_get or distributed/tests/test_client.py::test_Future_exception_sync_2 individually, they pass. However, if I run the entire distributed/tests/test_client.py module, then those two tests fail. This might have uncovered some unsound logic that was previously going unnoticed...

EDIT: Nvm, the test failures were due to updating the Dask config with the original values without completely clearing it beforehand. I've pushed up a fix

@jrbourbeau
Copy link
Member Author

cc @ian-r-rose if you get a chance to take a look at this

Copy link
Member

@fjetter fjetter left a comment

Choose a reason for hiding this comment

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

Love it

@jrbourbeau
Copy link
Member Author

Thanks for reviewing @fjetter!

@jrbourbeau jrbourbeau merged commit b0c9dc4 into dask:main Sep 7, 2021
@jrbourbeau jrbourbeau deleted the disable-preloads branch September 7, 2021 20:23
jrbourbeau added a commit that referenced this pull request Sep 9, 2021
This was referenced Sep 9, 2021
fjetter pushed a commit that referenced this pull request Sep 9, 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.

Make sure that preloads are not active during tests

2 participants