Skip to content

Conversation

@machichima
Copy link
Contributor

Description

Follow-up on #58852
Implementing the third step described in: #58630 (comment)

Mocking the operator to make test_hanging_detector_detects_issues test deterministic, prevent it depending on timing variation.

Related issues

Closes #58562

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

@machichima machichima requested a review from a team as a code owner November 28, 2025 07:17
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@machichima
Copy link
Contributor Author

Hi @bveeramani ,
This is the follow-up PR fixing the flaky test_hanging_detector_detects_issues test. PTAL.
Thank you!

@ray-gardener ray-gardener bot added train Ray Train Related Issue core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Nov 28, 2025
@machichima machichima changed the title [Test] make test_hanging_detector_detects_issues deterministic [Data][Test] make test_hanging_detector_detects_issues deterministic Dec 2, 2025
@owenowenisme owenowenisme added data Ray Data-related issues and removed core Issues that should be addressed in Ray Core train Ray Train Related Issue labels Dec 3, 2025
@owenowenisme owenowenisme self-assigned this Dec 3, 2025
@bveeramani
Copy link
Member

Thank you @machichima! I'm on vacation until the 7th. I'll take a look as soon as I'm back!

@omatthew98 omatthew98 self-assigned this Dec 3, 2025
Copy link
Contributor

@omatthew98 omatthew98 left a 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!

DataContext._set_current(copy)


@pytest.fixture(scope="module")
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed. Thank you!

@omatthew98 omatthew98 self-requested a review December 5, 2025 18:09
Copy link
Contributor

@omatthew98 omatthew98 left a 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!

@omatthew98 omatthew98 added the go add ONLY when ready to merge, run all tests label Dec 5, 2025
@alexeykudinkin alexeykudinkin enabled auto-merge (squash) December 5, 2025 18:16
@alexeykudinkin alexeykudinkin merged commit e73a866 into ray-project:master Dec 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Data][Flaky] test_hanging_detector_detects_issues intermittently fails to detect hanging

5 participants