Skip to content

Conversation

@fjetter
Copy link
Member

@fjetter fjetter commented Mar 4, 2022

I'm still poking at #5791 but I don't see a reason to postpone the removal of the 5s timeout.

What makes this line even worse is that it a global setting. The set is not used in a contextmanager so this leaks through to all tests, even those that are not using the clean fixture assuming it was once called in the interpreter.

To avoid having these kind of config leaks, I introduced a contextmanager that properly restores the original state once left and installed it as an autouse fixture.
IMO, the entire clean should be an autouse but I want to keep changes small for now

cc @graingert @crusaderky

Comment on lines 239 to 246
def reset_config():
warnings.warn(
"This methods will be removed soon. Consider using the contextmanager "
"distributed.utils_test.clean_config instead",
DeprecationWarning,
)
dask.config.config.clear()
dask.config.config.update(copy.deepcopy(original_config))
Copy link
Member Author

Choose a reason for hiding this comment

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

I consider this to be an anti-pattern and would suggest to remove this. utils_test is kind of a public API so we'll need to go through a deprecation cycle.

@fjetter
Copy link
Member Author

fjetter commented Mar 4, 2022

Wow, way too many failures for this change. I'll need to have a look

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2022

Unit Test Results

       12 files  ±0         12 suites  ±0   7h 32m 17s ⏱️ + 31m 36s
  2 623 tests ±0    2 529 ✔️  - 12    80 💤 ±0  12 +11  2 🔥 +1 
15 668 runs  +6  14 756 ✔️  - 42  860 💤  - 1  45 +43  7 🔥 +6 

For more details on these failures and errors, see this check.

Results for commit 3367f31. ± Comparison against base commit 39c5e88.

♻️ This comment has been updated with latest results.

warnings.warn(
"This methods will be removed soon. Consider using the contextmanager "
"distributed.utils_test.clean_config instead",
DeprecationWarning,
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
DeprecationWarning,
FutureWarning,

Copy link
Collaborator

@crusaderky crusaderky left a comment

Choose a reason for hiding this comment

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

Pending tests fix

@fjetter fjetter force-pushed the remove_connect_timeout_in_test branch from ad0f293 to 3367f31 Compare March 7, 2022 15:38
@fjetter fjetter closed this Jul 10, 2025
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