Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a short stress test for start/stop #11664

Merged
merged 7 commits into from
Apr 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions unit-tests/live/frames/test-pipeline-start-stop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2023 Intel Corporation. All Rights Reserved.

# test:device D400*
Copy link
Contributor

Choose a reason for hiding this comment

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

Why only D400?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Other are about to be deprecated, no need to add run time for them


import pyrealsense2 as rs
from rspy.stopwatch import Stopwatch
from rspy import test, log
import time
import platform


# Start depth + color streams and measure the time from stream opened until first frame arrived using pipeline API.
Copy link
Contributor

Choose a reason for hiding this comment

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

You also run IMU, better to write Start all streams...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed

# Verify that the time do not exceeds the maximum time allowed
Copy link
Contributor

Choose a reason for hiding this comment

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

does not

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

# Note - Using Windows Media Foundation to handle power management between USB actions take time (~27 ms)


# Set maximum delay for first frame according to product line
dev = test.find_first_device_or_exit()

def verify_frame_received(config):
pipe = rs.pipeline()
start_call_stopwatch = Stopwatch()
pipe.start(config)
f = pipe.wait_for_frames()
delay = start_call_stopwatch.get_elapsed()
log.out("After ", delay, " [sec] got first frame of ", f)
pipe.stop()


################################################################################################
test.start("Testing pipeline start/stop stress test")
for i in range(10):
Copy link
Contributor

Choose a reason for hiding this comment

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

10 is not "stress" test. Can you add a test case that will run only on nightly context with 1000 iterations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Its a mini stress test..
RealCI covers more.
The main idea is to see multiple start stop works.
1 min is enough

log.out("starting iteration #", i, "/", 10)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use i + 1 now last iteration is 9/10

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

cfg = rs.config()
cfg.enable_all_streams()
verify_frame_received(cfg)
test.finish()

################################################################################################
test.print_results_and_exit()