-
Notifications
You must be signed in to change notification settings - Fork 7k
[Data][Test] make test_hanging_detector_detects_issues deterministic #59060
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
[Data][Test] make test_hanging_detector_detects_issues deterministic #59060
Conversation
Signed-off-by: machichima <[email protected]>
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.
Code Review
This pull request makes the test_hanging_detector_detects_issues test deterministic by mocking the operator and avoiding time.sleep. The changes are well-implemented and achieve the goal of creating a more reliable test. I've suggested a small refactoring to the test to make it even more robust by mocking time.perf_counter, which avoids depending on the internal state of the detector.
Signed-off-by: machichima <[email protected]>
|
Hi @bveeramani , |
|
Thank you @machichima! I'm on vacation until the 7th. I'll take a look as soon as I'm back! |
omatthew98
left a comment
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.
Overall lgtm besides the redefinition of the fixture, once you fix that I will approve / get this merged. Thanks!
python/ray/data/tests/conftest.py
Outdated
| DataContext._set_current(copy) | ||
|
|
||
|
|
||
| @pytest.fixture(scope="module") |
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.
This fixture should already exist in python/ray/tests/conftest.py, let's use that fixture rather than redefining here.
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.
Removed. Thank you!
Signed-off-by: machichima <[email protected]>
omatthew98
left a comment
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.
Thanks, I will flag to the team for merge!
Description
Follow-up on #58852
Implementing the third step described in: #58630 (comment)
Mocking the operator to make
test_hanging_detector_detects_issuestest deterministic, prevent it depending on timing variation.Related issues
Closes #58562
Additional information