Skip to content

tests: exclude device setup from non-realtime deadlock timeout - #15443

Merged
Nir-Az merged 1 commit into
realsenseai:developmentfrom
Nir-Az:non-realtime-timeout
Jul 19, 2026
Merged

Nir-Az merged 1 commit into
realsenseai:developmentfrom
Nir-Az:non-realtime-timeout

Conversation

@Nir-Az

@Nir-Az Nir-Az commented Jul 19, 2026 •

Copy link
Copy Markdown
Collaborator

Overview: The non-realtime playback test's 20s deadlock timeout no longer counts device setup, so slow device power-on can't kill the whole test session.

Tracked on [RSDSO-21768]

Why

pytest.mark.timeout(20) in pytest-non-realtime.py uses pytest-timeout's default func_only=False, so the 20s budget includes fixture setup. For DDS devices (D555), setup alone — PoE power-on + DDS discovery — takes ~17s, so the timer can fire mid-setup. With timeout_method="thread" (our conftest default) pytest-timeout then calls os._exit(1): the entire pytest session dies mid-run — no retry, remaining tests never run, and no junit results are written.

Summary

  • Add func_only=True to the timeout mark: the 20s guard now covers only the test body (the DSO-15157 pipeline-stop deadlock it was written to catch).
  • Device setup is already self-bounded (port-disable and enumeration waits raise a normal, retryable failure), so it needs no budget of its own.

Test plan

  • Verified marker parses to Settings(timeout=20, func_only=True) and the test collects cleanly
  • Nightly CI run passes test_non_realtime_stop[D555] with device recycle in setup

🤖 Generated by AI

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Auto-generated review by rs-agentic bot 🤖

The fix is correct and well-motivated. pytest-timeout==2.2.0 is pinned so func_only=True is fully supported. One concern and one minor note below (inline).

# func_only: keep the tight deadlock guard on the test body only -- device setup (e.g. D555
# PoE power-on + DDS discovery takes ~17s) must not eat the budget; it has its own bounded waits
pytest.mark.timeout(20, func_only=True),
pytest.mark.context("weekly"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ [Auto-generated – rs-agentic bot]

func_only=True excludes both setup and teardown from the 20 s budget. Setup exclusion is the goal here, but teardown (device port-disable / re-enumeration in test_device) is now also unguarded. If teardown deadlocks, the session will hang indefinitely rather than hitting the os._exit path.

If test_device's teardown already has its own bounded waits (same as setup), this is fine — worth a quick confirmation.

@Nir-Az
Nir-Az requested a review from AviaAv July 19, 2026 08:05

@AviaAv AviaAv 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.

LGTM

@Nir-Az
Nir-Az merged commit 43ce478 into realsenseai:development Jul 19, 2026
28 of 29 checks passed
@Nir-Az
Nir-Az deleted the non-realtime-timeout branch August 11, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants