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

Integration test for ungraceful stop of camera recorder pipeline #150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vangork
Copy link
Contributor

@vangork vangork commented Dec 22, 2021

  1. keep simulate-failure-after-sec instead of simulate-failure-at as pravegatimestamp doesn't support the construct from a datetime string.
  2. throw gst::FlowError::Error instead of close pravega byte writer as drop writer dosen't seem to be working and rust client dosen't provide with the close method.
...
Dec 22 04:33:16.319  INFO integration_test::rtsp_camera_simulator: RTSP server stopping
{ "type": "test", "name": "camera_recorder_tests::test::test_ungraceful_stop::case_1", "event": "ok", "exec_time": 76.2003823 }
{ "type": "suite", "event": "ok", "passed": 1, "failed": 0, "allowed_fail": 0, "ignored": 0, "measured": 0, "filtered_out": 39, "exec_time": 76.200515103 }
Dec 22 04:33:16.319  INFO integration_test::rtsp_camera_simulator: RTSP server stopped

@vangork vangork requested a review from claudiofahey December 22, 2021 04:48
// TODO: close pravega writers
//drop(writer.get_mut().get_mut().get_mut());
//drop(index_writer);
gst::element_error!(element, gst::CoreError::Failed, ["Simulate pravegasink failure"]);

Choose a reason for hiding this comment

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

I don't see "Simulate pravegasink failure" in the test log. How can I confirm that this is actually simulating a failure?
Also, by not closing the writer, this is effectively performing a graceful stop as you can tell from these log messages:

0:00:35.579572114 50606 0x558c7e3ab860 INFO             pravegasink gst-plugin-pravega/src/pravegasink/imp.rs:1167:gstpravega::pravegasink::imp:<pravegasink0> stop: BEGIN
0:00:35.581769200 50606 0x558c7e3ab860 INFO             pravegasink gst-plugin-pravega/src/pravegasink/imp.rs:1221:gstpravega::pravegasink::imp:<pravegasink0> stop: Wrote final index record IndexRecord { timestamp: 2022-01-04T18:12:48.404852888Z (1641320005404852888 ns, 455922:13:25.404852888), offset: 163880, random_access: false, discontinuity: false }
0:00:35.583745207 50606 0x558c7e3ab860 INFO             pravegasink gst-plugin-pravega/src/pravegasink/imp.rs:1250:gstpravega::pravegasink::imp:<pravegasink0> stop: END: result=Ok(())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

log "Simulate pravegasink failure" in info.


#[rstest]
#[case(Realtime, 30, 15)]
fn test_ungraceful_stop(#[case] clock_type: gst::ClockType, #[case] num_sec_to_record: u64, #[case] num_sec_to_failure: u64) {

Choose a reason for hiding this comment

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

Add a comment describing what this test is supposed to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

let _ = launch_pipeline_and_get_summary(format!("{} simulate-failure-after-sec={}", pipeline_description, num_sec_to_failure).as_ref());

info!("#### Read recorded stream from Pravega, no demux, no decoding, part 1");
let pipeline_description_read = format!(

Choose a reason for hiding this comment

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

This should test that the video is also decodable. Use the code from https://github.com/pravega/gstreamer-pravega/blob/master/integration-test/src/rtsp_tests.rs#L200-L228. Some frames around the ungraceful stop may be corrupted but others before and after should be good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

@vangork vangork force-pushed the STRM-10162-integration-test-ungraceful-stop branch from ccedf96 to 6f24702 Compare January 16, 2022 07:49
Signed-off-by: Luis Liu <[email protected]>
@vangork vangork requested a review from claudiofahey January 16, 2022 15:25
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