tests: pipeline: try to make test_pipeline_reset_start_time more reliable

Occasionally this test would fail, especially if the system is under load,
because the position query would pick up the last position from the
last buffer timestamp which has a lower timestamp than what we're
looking for. The sleep is long enough, however. It's unclear to me why
exactly this happens but there seems to be some kind of scheduling
issue going on as the streaming thread floods the sink with buffers.

Let's throttle the fakesrc to 100 buffers per second and make the sink
sync to the clock to restore some sanity. It should be totally sufficient
to test what we want to test, and seems to make things reliable here.
This commit is contained in:
Tim-Philipp Müller 2018-02-15 13:36:26 +00:00
parent dd78aa27a4
commit f6b1533e7a

View file

@ -586,7 +586,11 @@ GST_START_TEST (test_pipeline_reset_start_time)
fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
fakesink = gst_element_factory_make ("fakesink", "fakesink");
g_object_set (fakesrc, "do-timestamp", TRUE, "format", GST_FORMAT_TIME, NULL);
/* no more than 100 buffers per second */
g_object_set (fakesrc, "do-timestamp", TRUE, "format", GST_FORMAT_TIME,
"sizetype", 2, "sizemax", 4096, "datarate", 4096 * 100, NULL);
g_object_set (fakesink, "sync", TRUE, NULL);
fail_unless (pipeline && fakesrc && fakesink);