Skip to content

Ci: testing frame order and fps - #330

Closed
Kontra2B wants to merge 24 commits into
realsenseai:devfrom
Kontra2B:CI
Closed

Ci: testing frame order and fps#330
Kontra2B wants to merge 24 commits into
realsenseai:devfrom
Kontra2B:CI

Conversation

@Kontra2B

Copy link
Copy Markdown
Contributor

Functional V4L2 camera FPS test verifies:

  • frame order for repeated and dropped frames (no frame number repetition and 1 drop allowed)
  • each frame FPS calculated from time delta falls within KPI
  • requeseted frame count arrive

@Kontra2B
Kontra2B requested review from Copilot and ymodlin December 29, 2025 12:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive FPS testing for V4L2 cameras, verifying frame timing, sequencing, and delivery. The implementation validates that frames arrive at the correct rate, in proper order, and without significant drops.

Key changes:

  • New test_fps.py validates frame rates, detects dropped/repeated frames, and ensures frame counts match expectations
  • Enhanced test_fw_version.py with proper Python 3 string handling using .decode()
  • Added Jenkins pipeline configuration for automated CI testing

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/test_fps.py New test validating FPS accuracy, frame ordering, and completeness across different video formats
test/test_fw_version.py Fixed Python 3 compatibility by decoding subprocess output to strings
test/test_metadata/build.sh Added debug flags and removed test execution from build script
test/run_ci.py Improved error reporting and added missing exit code on usage error
test/pytest.ini Added pytest configuration with d457 marker for device-specific tests
test/groovy/LRS_libci_pipeline.groovy New Jenkins pipeline for automated artifact deployment and testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/test_fps.py
# print(f"{frame}", end='')
if last:
assert frame > last, f"Repeated frame: {frame}"
assert (frame - last) < 3 , f"Frames dropped between: {last} and {frame}"

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

This assertion allows up to 2 dropped frames, but the PR description states that only 1 drop is allowed. Change < 3 to < 2 to match the specification.

Suggested change
assert (frame - last) < 3 , f"Frames dropped between: {last} and {frame}"
assert (frame - last) < 2 , f"Frames dropped between: {last} and {frame}"

Copilot uses AI. Check for mistakes.
Comment thread test/test_fps.py
timeout=timeout).stderr.splitlines()
last = None
skip = True # skip first FPS measurement
kpi = 5 # [%]

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

The KPI threshold of 5% is a magic number that should be extracted as a constant or test parameter to improve maintainability and make it easier to adjust.

Copilot uses AI. Check for mistakes.
Comment thread test/test_fps.py
f"{frames}",
"--verbose",
]
timeout = 4.0 * frames / FPS

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

The timeout multiplier of 4.0 is a magic number. Consider extracting it as a named constant (e.g., TIMEOUT_MULTIPLIER) to clarify its purpose and make it easier to adjust.

Copilot uses AI. Check for mistakes.
Comment thread test/run_ci.py
check=True )
except Exception as e:
print( "Exception occurred.")
print("Exception occurred: {}".format( e ))

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

Inconsistent spacing: there's an extra space before the closing parenthesis in .format( e ). Should be .format(e) to match Python style conventions.

Copilot uses AI. Check for mistakes.
@Kontra2B Kontra2B closed this Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants