From d2aceab54b3a203df3de0b416e4790efc9933525 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 17 Feb 2025 16:10:21 +0530 Subject: [PATCH] hlsmultivariantsink: Serialise tests and increase channel timeout Serialise the tests and increase the recv_timeout as it may not be enough on the CI to do H264/H265 encoding for 1080p streams which are we using for testing. Part-of: --- Cargo.lock | 1 + net/hlsmultivariantsink/Cargo.toml | 1 + .../tests/hlsmultivariantsink.rs | 19 +++++++++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f4741738..fc75fca53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2763,6 +2763,7 @@ dependencies = [ "gstreamer-pbutils", "gstreamer-video", "m3u8-rs", + "serial_test", "thiserror 2.0.11", ] diff --git a/net/hlsmultivariantsink/Cargo.toml b/net/hlsmultivariantsink/Cargo.toml index d3e0f6a57..8a9ad3332 100644 --- a/net/hlsmultivariantsink/Cargo.toml +++ b/net/hlsmultivariantsink/Cargo.toml @@ -30,6 +30,7 @@ m3u8-rs = "5.0" anyhow = "1" gst-plugin-hlssink3 = { path = "../hlssink3" } gst-plugin-fmp4 = { path = "../../mux/fmp4" } +serial_test = "3" [build-dependencies] gst-plugin-version-helper.workspace = true diff --git a/net/hlsmultivariantsink/tests/hlsmultivariantsink.rs b/net/hlsmultivariantsink/tests/hlsmultivariantsink.rs index 37dfe4ba6..0c93248df 100644 --- a/net/hlsmultivariantsink/tests/hlsmultivariantsink.rs +++ b/net/hlsmultivariantsink/tests/hlsmultivariantsink.rs @@ -14,6 +14,7 @@ use gio::prelude::*; use gst::prelude::*; use gsthlsmultivariantsink::{HlsMultivariantSinkMuxerType, HlsMultivariantSinkPlaylistType}; +use serial_test::serial; use std::io::Write; use std::str::FromStr; use std::sync::mpsc::SyncSender; @@ -323,6 +324,7 @@ fn setup_signals( } #[test] +#[serial] fn hlsmultivariantsink_multiple_audio_rendition_multiple_video_variant() -> Result<(), ()> { init(); @@ -456,7 +458,7 @@ fn hlsmultivariantsink_multiple_audio_rendition_multiple_video_variant() -> Resu assert!(eos); let mut actual_events = Vec::new(); - while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_millis(1)) { + while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_secs(30)) { actual_events.push(event); } let expected_events = { @@ -509,6 +511,7 @@ low/video.m3u8 } #[test] +#[serial] fn hlsmultivariantsink_multiple_audio_rendition_single_video_variant() -> Result<(), ()> { init(); @@ -618,7 +621,7 @@ fn hlsmultivariantsink_multiple_audio_rendition_single_video_variant() -> Result assert!(eos); let mut actual_events = Vec::new(); - while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_millis(1)) { + while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_secs(30)) { actual_events.push(event); } let expected_events = { @@ -659,6 +662,7 @@ hi/video.m3u8 } #[test] +#[serial] fn hlsmultivariantsink_single_audio_rendition_multiple_video_variant() -> Result<(), ()> { init(); @@ -776,7 +780,7 @@ fn hlsmultivariantsink_single_audio_rendition_multiple_video_variant() -> Result assert!(eos); let mut actual_events = Vec::new(); - while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_millis(1)) { + while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_secs(30)) { actual_events.push(event); } let expected_events = { @@ -824,6 +828,7 @@ low/video.m3u8 } #[test] +#[serial] fn hlsmultivariantsink_multiple_audio_rendition_multiple_video_variant_with_mpegts( ) -> Result<(), ()> { init(); @@ -953,7 +958,7 @@ fn hlsmultivariantsink_multiple_audio_rendition_multiple_video_variant_with_mpeg assert!(eos); let mut actual_events = Vec::new(); - while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_millis(1)) { + while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_secs(30)) { actual_events.push(event); } let expected_events = { @@ -999,6 +1004,7 @@ low/video.m3u8 } #[test] +#[serial] fn hlsmultivariantsink_multiple_video_variant_with_mpegts_audio_video_muxed() -> Result<(), ()> { init(); @@ -1125,7 +1131,7 @@ fn hlsmultivariantsink_multiple_video_variant_with_mpegts_audio_video_muxed() -> assert!(eos); let mut actual_events = Vec::new(); - while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_millis(1)) { + while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_secs(30)) { actual_events.push(event); } let expected_events = { @@ -1164,6 +1170,7 @@ low-audio/audio-only.m3u8 } #[test] +#[serial] fn hlsmultivariantsink_multiple_audio_rendition_multiple_video_variant_with_mpegts_h265( ) -> Result<(), ()> { init(); @@ -1301,7 +1308,7 @@ fn hlsmultivariantsink_multiple_audio_rendition_multiple_video_variant_with_mpeg assert!(eos); let mut actual_events = Vec::new(); - while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_millis(1)) { + while let Ok(event) = hls_events_receiver.recv_timeout(Duration::from_secs(30)) { actual_events.push(event); } let expected_events = {