Skip to content

[Core] deflake test_dashboard - #63220

Merged
edoakes merged 2 commits into
ray-project:masterfrom
sampan-s-nayak:fix-test-dashboard
May 13, 2026
Merged

edoakes merged 2 commits into
ray-project:masterfrom
sampan-s-nayak:fix-test-dashboard

Conversation

@sampan-s-nayak

Copy link
Copy Markdown
Contributor

No description provided.

@sampan-s-nayak
sampan-s-nayak requested a review from a team as a code owner May 8, 2026 07:10
@sampan-s-nayak sampan-s-nayak added the go add ONLY when ready to merge, run all tests label May 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 introduces a 30-second timeout to multiple wait_for_condition calls within test_dashboard.py to ensure agent registration. Feedback suggests defining a module-level constant for the timeout and refactoring the repeated wait-and-search logic into a helper function to improve maintainability and reduce code duplication.


logger.info("Test agent register is OK.")
wait_for_condition(lambda: search_agent(raylet_proc.children()))
wait_for_condition(lambda: search_agent(raylet_proc.children()), timeout=30)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The timeout value 30 is hardcoded in 7 different locations in this file (lines 147, 191, 212, 256, 298, 1365, 1415). To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, consider defining a module-level constant such as AGENT_STARTUP_TIMEOUT_SECONDS = 30. Furthermore, refactoring the repeated pattern of calling wait_for_condition followed by search_agent into a single helper function would reduce code duplication and the number of redundant system calls to retrieve the process list.

@ray-gardener ray-gardener Bot added the core Issues that should be addressed in Ray Core label May 8, 2026
@Kunchd

Kunchd commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

@sampan-s-nayak Could we add some investigation note in the PR description that justifies why the 30 seconds timeout is needed?

@sampan-s-nayak

Copy link
Copy Markdown
Contributor Author

there is no concrete reason for choosing 30 seconds exactly, I looked at a couple of flaky runs and the main thing standing out is that the test fails while waiting for dashboard agent to come up (we were previously using a default timeout of 10seconds). my guess is that agent startup is probably taking longer than this in some cases and hence leading to the test failure. I am bumping up the timeout here to deflake. but to properly point out the root cause I feel we would have to invest effort in going through the entire startup mechanism and make potential improvements there.

@sampan-s-nayak

Copy link
Copy Markdown
Contributor Author

@Kunchd could you ptal

@edoakes
edoakes merged commit d6bab4f into ray-project:master May 13, 2026
3 checks passed
alexandrplashchinsky pushed a commit to alexandrplashchinsky/ray-alex that referenced this pull request May 29, 2026
Signed-off-by: sampan <[email protected]>
Co-authored-by: sampan <[email protected]>
Signed-off-by: Alexandr Plashchinsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants