Skip to content

test(Gate): make the two-stream gate_node_test cases robust to a slow host - #2350

Open
aljazkonec1 wants to merge 1 commit into
developfrom
test/gate-node-poe-bandwidth
Open

aljazkonec1 wants to merge 1 commit into
developfrom
test/gate-node-poe-bandwidth

Conversation

@aljazkonec1

@aljazkonec1 aljazkonec1 commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

What: gate_node_test "Two Queue from one camera" and "FPS regulation" use 320x200 frames, read all queued frames in each loop and sleep 1 ms. The checks do not change (test code only).
Root cause: on the slow RVC2 PoE ASan host, the two 640x400 streams (17 MB/s) and the busy tryGet loop got only ~7 MB/s, so the device throttled the camera and the gate passed every frame: 27 gate / 27 camera (13 earlier PoE runs: 44-45 / 88-89).
Proof (RVC2 USB, test at nice 19 on one CPU core with 3-6 busy processes): develop 9-24 gate / 17-79 camera (fails, same signature); this PR 35-49 / 66-100 (passes). Unloaded: 45 / 89, full file 3/3 passes; a gate without the fps limit still fails (89 < 50).
Impact: Low impact. Ready to merge after review and HIL.

Summary by CodeRabbit

  • Tests
    • Updated validation for camera output queues and frame-rate regulation using smaller frames and repeated queue draining. Existing frame-count checks remain unchanged.

… host

On the RVC2 PoE ASan job the host received about 7 MB/s, and "FPS
regulation" got 27 gate and 27 camera frames: the device throttled the
camera, so the gate passed every frame. The two 640x400 streams need
17 MB/s, and the busy tryGet loop takes CPU time from the XLink reader
threads on a loaded host.

"Two Queue from one camera" and "FPS regulation" now use 320x200
frames, read all queued frames each iteration and sleep 1 ms. The
checks do not change.
@aljazkonec1 aljazkonec1 added testable Trigger PR testing, latest python build, and Core CI/CD Low impact Small bugfixes, tests, simple changes labels Dec 2, 2026
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The “Two Queue from one camera” and “FPS regulation” tests now use 320×200 frames. Their polling loops count all queued frames and sleep for 1 ms.

Changes: Gate node test polling

Layer / File(s) Summary
Camera frame polling
tests/src/ondevice_tests/pipeline/node/gate_node_tests.cpp
Both tests request 320×200 frames. Their polling loops drain all queued frames from both outputs and sleep for 1 ms. Existing frame-count assertions remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: jakubfara

Merge Risk: Minimal · up to dded7

This change only makes two gate node tests more reliable on slow or loaded hosts. It has no production behavior impact and is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the conventional type(scope) prefix and names the change: making two gate_node_test cases more robust on a slow host. The raw summary and objectives confirm the change targets the 'Two …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the conventional type(scope) prefix and names the change: making two gate_node_test cases more robust on a slow host. The raw summary and objectives confirm the change targets the 'Two Queue from one camera' and 'FPS regulation' cases by reducing frame size, draining queued frames, and adding a 1 ms sleep. The title names the test file scope (Gate) and the two-stream cases, so it matches the main change. It does not name the specific mechanisms (resolution reduction, sleep), which is acceptable since the title need not cover every detail.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks each frame in line
Then counts the queues, one by one
Smaller images pass along
A tiny pause keeps polling calm
The tests hop onward, all frames done

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e264c815-8806-4cf5-8779-1a8a9fc827fe
Commits

Reviewing files that changed from the base of the PR and between 4d2642c and dded795.

Files selected for processing: 1

  • tests/src/ondevice_tests/pipeline/node/gate_node_tests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 7

  • GitHub Check: rvc4-fwp / reuse-or-build
  • GitHub Check: style
  • GitHub Check: consistency
  • GitHub Check: Required Python CI report
  • GitHub Check: Run HIL tests (open Details)
  • GitHub Check: Run Linux PR HIL tests / rvc4-fwp / reuse-or-build
  • GitHub Check: Comment lint
Additional comments: 5

tests/src/ondevice_tests/pipeline/node/gate_node_tests.cpp: 5

6-6: LGTM!

251-252: LGTM!

282-284: LGTM!

298-299: LGTM!

330-332: LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Low impact Small bugfixes, tests, simple changes testable Trigger PR testing, latest python build, and Core CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant