-
-
Notifications
You must be signed in to change notification settings - Fork 270
[MNT] Fix race condition in OpenMLSplit tests during parallel execution #1641 #1694
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
Open
codervinitjangir
wants to merge
9
commits into
openml:main
Choose a base branch
from
codervinitjangir:fix/race-condition-split
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
447aff1
fix: race condition in OpenMLSplitTest when running tests in parallel…
codervinitjangir b29157d
Merge branch 'main' into fix/race-condition-split
codervinitjangir 6d0b51d
Apply maintainer cleanup suggestions
codervinitjangir 981213d
Fix race condition setup by preserving temp dir and restoring eq test
codervinitjangir d962e74
Revert setUp to original main branch state and adapt tearDown
codervinitjangir ebe11c3
Revert setUp to match upstream main, simplify tearDown as requested
codervinitjangir f6bac1f
Merge branch 'main' into fix/race-condition-split
codervinitjangir 758577e
Merge branch 'main' into fix/race-condition-split
codervinitjangir 7f00928
Merge branch 'main' into fix/race-condition-split
PGijsbers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix race condition setup by preserving temp dir and restoring eq test
- Loading branch information
commit 981213d5f0d95f592fa5cf1bf7b409377837d4ed
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |||
| import inspect | ||||
| import os | ||||
| import shutil | ||||
| import tempfile | ||||
| from pathlib import Path | ||||
|
|
||||
| import numpy as np | ||||
|
|
@@ -20,10 +21,11 @@ class OpenMLSplitTest(TestBase): | |||
|
|
||||
| def setUp(self): | ||||
| super().setUp() | ||||
| self._temp_dir = tempfile.TemporaryDirectory() | ||||
| __file__ = inspect.getfile(OpenMLSplitTest) | ||||
| self.directory = os.path.dirname(__file__) | ||||
| # This is for dataset | ||||
| self.arff_filepath = ( | ||||
| source_arff = ( | ||||
| Path(self.directory).parent | ||||
| / "files" | ||||
| / "org" | ||||
|
|
@@ -33,13 +35,16 @@ def setUp(self): | |||
| / "1882" | ||||
| / "datasplits.arff" | ||||
| ) | ||||
| self.arff_filepath = Path(self._temp_dir.name) / "datasplits.arff" | ||||
| shutil.copy(source_arff, self.arff_filepath) | ||||
| self.pd_filename = self.arff_filepath.with_suffix(".pkl.py3") | ||||
|
|
||||
| def tearDown(self): | ||||
| self._temp_dir.cleanup() | ||||
|
|
||||
| def test_eq(self): | ||||
| split = OpenMLSplit._from_arff_file(self.arff_filepath) | ||||
| assert split == split # noqa: PLR0124 | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this line can be removed
Suggested change
|
||||
|
|
||||
| split2 = OpenMLSplit._from_arff_file(self.arff_filepath) | ||||
| split2.name = "a" | ||||
|
|
||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't change anything here, keep it as it was
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1694 (comment) is still unresolved