Repository navigation
Retry D585S service-mode switch to handle post-enumeration FW readiness race - #15329
Merged
Merged
Conversation
…ss race (RSDEV-12509)
… without pyrealsense2
…e timeout to 30s for first-try reliability
sysrsbuild-gh-agentic
left a comment
Collaborator
There was a problem hiding this comment.
[rs-agentic bot] Automated review of PR #15329 — synchronize event. No Copilot reviewer detected, proceeding with full inline review.
…beyond ~3.6s; longer waits never recovered)
…op redundant import, add trailing newline
Collaborator
Author
|
Thanks for the review (rs-agentic bot). Addressed in Fixed (
Not changing — with rationale:
Already resolved: the 60s-timeout thread (reduced to 8s in 🤖 Generated by AI |
kojokaro
approved these changes
Jul 1, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview: On the D585S, the test wrappers switched safety mode immediately, but the FW can transiently reject a
safety_modechange (RuntimeError: Failed to set the option to value N) — especially the first attempt after enumeration / disruptive ops under CI load. This flaked the d500 safety suite and tests entering service mode viatest_device_wrapped(e.g.test_advanced_mode_support,test_depth_laser_on), bench-to-bench on identical FW.Root cause: Transient FW readiness. A first
set_optionattempt often fails (blocks ~3s, throws); a retry succeeds. Across 330 logged transitions the success envelope is tight — 1 attempt (<2s) or 2 attempts (~3.6s); no transition ever succeeded beyond ~3.6s.get_safety_interface_config()isn't a reliable readiness signal, so retrying the actualset_optionis what works.Fix:
tests_wrapper.set_safety_mode(safety_sensor, mode, timeout=8, interval=0.5)retry helper (usesrspy.stopwatch.Stopwatch, logssafety_mode set to <mode> after N attempt(s), Xs), routed through every D585S safety-mode transition:rspy/tests_wrapper.py→start_wrapper/stop_wrapperconftest.py→test_device_wrapped(enter + teardown)pytest-operational-mode.py,pytest-operational-mode-stress.py,pytest-interface-config-get-set.py(post-reboot)Timeout is 8s (~2× the 3.6s worst observed success); larger values were tried but never recovered anything a small retry didn't — the rare truly-stuck transition recovers only via a full test rerun, tracked separately in RSDEV-12512 (module-scoped
test_device_wrappedcan't re-setup on pytest-retry → hard error). D585S-only; other devices untouched.CI verification (vtglnx163 + D585S 333622320169):
-r d500 --repeat 3, 261 tests): 0 retries.Jira: RSDEV-12509 (fix), RSDEV-12512 (fixture-retry fragility), RSDEV-12232 (FW-side, closed)
🤖 Generated by AI