Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TST Do not use cache in test in test_fetch_openml_iris #19594

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

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Closes #19587

What does this implement/fix? Explain your changes.

Test in sklearn/datasets/tests/test_openml.py should not be touching the cache.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Sounds reasonable, but can you share your analysis of the original problem? Is this because the fetch_openml's caching mechanism is not concurrency-safe when running on pytest-xdist?

@thomasjpfan
Copy link
Member Author

My guess is one process creates the directory and begins to populates the cache with 61.gz a second process will try to read it and find that is is corrupted because the first process did not finish writing the cache file. This second process calls

def _retry_with_clean_cache(

which removes the file. Then the first process tries to read the file that it suppose to be caching and found that it was removed. I can see this randomly happen if test_fetch_openml_iris[True] and test_fetch_openml_iris[False] are run on different processes.

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @thomasjpfan

@jeremiedbb jeremiedbb merged commit bfd7b58 into scikit-learn:main Mar 12, 2021
marrodion pushed a commit to marrodion/scikit-learn that referenced this pull request Mar 17, 2021
@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
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.

Random failure in fetch_openml tests
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.