From 98fbbe7a53ff5ec1099303d860d1683925193e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alicia=20Boya=20Garc=C3=ADa?= Date: Wed, 21 Jun 2023 16:24:12 +0200 Subject: [PATCH] tests: nle: Set sync=FALSE on sinks A significant portion of the NLE test suite was often timing out due to the tests taking way longer than necessary because the sinks were synchronizing to the clock, which is the default behavior for fakevideosink and fakeaudiosink. Notable was the case of nleoperation.c:test_pyramid_operations, that ran through a 10 second stream twice. As the default timeout is 20 seconds, this made the test flaky. Part-of: --- subprojects/gst-editing-services/tests/check/nle/complex.c | 2 ++ .../gst-editing-services/tests/check/nle/nlecomposition.c | 7 +++++++ .../gst-editing-services/tests/check/nle/nleoperation.c | 1 + .../gst-editing-services/tests/check/nle/nlesource.c | 2 ++ subprojects/gst-editing-services/tests/check/nle/seek.c | 1 + subprojects/gst-editing-services/tests/check/nle/simple.c | 4 ++++ .../gst-editing-services/tests/check/nle/tempochange.c | 1 + 7 files changed, 18 insertions(+) diff --git a/subprojects/gst-editing-services/tests/check/nle/complex.c b/subprojects/gst-editing-services/tests/check/nle/complex.c index b7358fbc64..ffb73cd4d5 100644 --- a/subprojects/gst-editing-services/tests/check/nle/complex.c +++ b/subprojects/gst-editing-services/tests/check/nle/complex.c @@ -15,6 +15,7 @@ fill_pipeline_and_check (GstElement * comp, GList * segments, pipeline = gst_pipeline_new ("test_pipeline"); sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); @@ -563,6 +564,7 @@ GST_START_TEST (test_renegotiation) sink = gst_element_factory_make_or_warn ("fakeaudiosink", "sink"); + g_object_set (sink, "sync", FALSE, NULL); audioconvert = gst_element_factory_make_or_warn ("audioconvert", "aconv"); gst_bin_add_many (GST_BIN (pipeline), comp, audioconvert, sink, NULL); diff --git a/subprojects/gst-editing-services/tests/check/nle/nlecomposition.c b/subprojects/gst-editing-services/tests/check/nle/nlecomposition.c index 3607ddb3dc..6cb8eee606 100644 --- a/subprojects/gst-editing-services/tests/check/nle/nlecomposition.c +++ b/subprojects/gst-editing-services/tests/check/nle/nlecomposition.c @@ -54,6 +54,7 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack) gst_element_set_state (comp, GST_STATE_READY); sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); gst_element_link (comp, sink); @@ -218,6 +219,7 @@ GST_START_TEST (test_remove_last_object) gst_element_set_state (GST_ELEMENT (composition), GST_STATE_READY); fakesink = gst_element_factory_make ("fakeaudiosink", NULL); + g_object_set (fakesink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), GST_ELEMENT (composition), fakesink, NULL); gst_element_link (GST_ELEMENT (composition), fakesink); @@ -309,6 +311,7 @@ GST_START_TEST (test_dispose_on_commit) composition = gst_element_factory_make ("nlecomposition", "composition"); pipeline = GST_ELEMENT (gst_pipeline_new (NULL)); fakesink = gst_element_factory_make ("fakevideosink", NULL); + g_object_set (fakesink, "sync", FALSE, NULL); nlesource = gst_element_factory_make ("nlesource", "nlesource1"); audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1"); @@ -353,6 +356,7 @@ GST_START_TEST (test_simple_audiomixer) composition = gst_element_factory_make ("nlecomposition", "composition"); gst_element_set_state (composition, GST_STATE_READY); fakesink = gst_element_factory_make ("fakeaudiosink", NULL); + g_object_set (fakesink, "sync", FALSE, NULL); /* nle_audiomixer */ nle_audiomixer = gst_element_factory_make ("nleoperation", "nle_audiomixer"); @@ -483,6 +487,7 @@ GST_START_TEST (test_seek_on_nested) gst_element_set_state (comp, GST_STATE_READY); sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); gst_element_link (comp, sink); @@ -578,6 +583,7 @@ GST_START_TEST (test_error_in_nested_timeline) gst_element_set_state (comp, GST_STATE_READY); sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); gst_element_link (comp, sink); @@ -664,6 +670,7 @@ GST_START_TEST (test_nest_deep) gst_element_set_state (comp, GST_STATE_READY); sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); gst_element_link (comp, sink); diff --git a/subprojects/gst-editing-services/tests/check/nle/nleoperation.c b/subprojects/gst-editing-services/tests/check/nle/nleoperation.c index 2e8be8b0f8..1c5686f211 100644 --- a/subprojects/gst-editing-services/tests/check/nle/nleoperation.c +++ b/subprojects/gst-editing-services/tests/check/nle/nleoperation.c @@ -14,6 +14,7 @@ fill_pipeline_and_check (GstElement * comp, GList * segments) pipeline = gst_pipeline_new ("test_pipeline"); sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); diff --git a/subprojects/gst-editing-services/tests/check/nle/nlesource.c b/subprojects/gst-editing-services/tests/check/nle/nlesource.c index 72aee071ce..3782b7cbc4 100644 --- a/subprojects/gst-editing-services/tests/check/nle/nlesource.c +++ b/subprojects/gst-editing-services/tests/check/nle/nlesource.c @@ -26,6 +26,7 @@ GST_START_TEST (test_simple_videotestsrc) sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), nlesource, sink, NULL); @@ -126,6 +127,7 @@ GST_START_TEST (test_videotestsrc_in_bin) sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), nlesource, sink, NULL); diff --git a/subprojects/gst-editing-services/tests/check/nle/seek.c b/subprojects/gst-editing-services/tests/check/nle/seek.c index 8bd530c145..84c460c853 100644 --- a/subprojects/gst-editing-services/tests/check/nle/seek.c +++ b/subprojects/gst-editing-services/tests/check/nle/seek.c @@ -37,6 +37,7 @@ fill_pipeline_and_check (GstElement * comp, GList * segments, GList * seeks) pipeline = gst_pipeline_new ("test_pipeline"); sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); diff --git a/subprojects/gst-editing-services/tests/check/nle/simple.c b/subprojects/gst-editing-services/tests/check/nle/simple.c index e6cbfe786d..d83ba69248 100644 --- a/subprojects/gst-editing-services/tests/check/nle/simple.c +++ b/subprojects/gst-editing-services/tests/check/nle/simple.c @@ -41,6 +41,7 @@ test_simplest_full (void) sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); @@ -258,6 +259,7 @@ test_one_after_other_full (void) sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); @@ -461,6 +463,7 @@ test_one_under_another_full (void) sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); @@ -615,6 +618,7 @@ test_one_bin_after_other_full (void) sink = gst_element_factory_make_or_warn ("fakevideosink", "sink"); fail_if (sink == NULL); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); diff --git a/subprojects/gst-editing-services/tests/check/nle/tempochange.c b/subprojects/gst-editing-services/tests/check/nle/tempochange.c index e3d8208cc4..0454f5cc26 100644 --- a/subprojects/gst-editing-services/tests/check/nle/tempochange.c +++ b/subprojects/gst-editing-services/tests/check/nle/tempochange.c @@ -284,6 +284,7 @@ _setup_test (GstElement * pipeline, gdouble rate) /* sink */ sink = gst_element_factory_make_or_warn ("fakeaudiosink", "sink"); + g_object_set (sink, "sync", FALSE, NULL); gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL); gst_element_link (comp, sink);