Repository navigation
[Core] deflake test_dashboard - #63220
Conversation
Signed-off-by: sampan <[email protected]>
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Signed-off-by: sampan <[email protected]>
|
@sampan-s-nayak Could we add some investigation note in the PR description that justifies why the 30 seconds timeout is needed? |
|
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. |
|
@Kunchd could you ptal |
Signed-off-by: sampan <[email protected]> Co-authored-by: sampan <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
No description provided.