[Tests/GstMQTT] Increase the timeout for receiving a message
authorWook Song <wook16.song@samsung.com>
Tue, 6 Jul 2021 06:50:27 +0000 (15:50 +0900)
committerSangjung Woo <again4you@gmail.com>
Thu, 8 Jul 2021 00:28:11 +0000 (09:28 +0900)
The default timeout, 10 secs, for receiving a message from the
subscribed topic might be short for sandboxed-test environments such as
GBS and Pbuilder. To avoid failure of GstMQTT test cases due to the
timeout, this patch increases the timeout to 1 min instead of using the
defualt one, 10 secs.

Signed-off-by: Wook Song <wook16.song@samsung.com>
tests/gstreamer_mqtt/unittest_mqtt_w_helper.cc

index 4ccf5fc..295d3d8 100644 (file)
@@ -384,9 +384,10 @@ TEST (testMqttSrcWithHelper, srcNormalLaunch0)
   gchar *caps_str = g_strdup ("video/x-raw,width=640,height=320,format=RGB");
   gchar *topic_name = g_strdup ("test_topic");
   gchar *str_pipeline = g_strdup_printf (
-      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d ! "
+      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d "
+      "sub-timeout=%" G_GINT64_FORMAT " ! "
       "capsfilter caps=%s ! videoconvert ! videoscale ! fakesink",
-      topic_name, 1, caps_str);
+      topic_name, 1, G_TIME_SPAN_MINUTE, caps_str);
   GError *err = NULL;
   GstElement *pipeline;
   GstStateChangeReturn ret;
@@ -457,9 +458,10 @@ TEST (testMqttSrcWithHelper, srcNormalLaunch1)
   gchar *caps_str = g_strdup ("video/x-raw,width=640,height=320,format=RGB");
   gchar *topic_name = g_strdup ("test_topic");
   gchar *str_pipeline = g_strdup_printf (
-      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d ! "
+      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d "
+      "sub-timeout=%" G_GINT64_FORMAT " ! "
       "capsfilter caps=%s ! videoconvert ! videoscale ! fakesink",
-      topic_name, 2, caps_str);
+      topic_name, 2, G_TIME_SPAN_MINUTE, caps_str);
   GError *err = NULL;
   GstElement *pipeline;
   GstStateChangeReturn ret;
@@ -544,9 +546,10 @@ TEST (testMqttSrcWithHelper, srcNormalLaunch0_n)
   gchar *caps_str = g_strdup ("video/x-raw,width=640,height=320,format=RGB");
   gchar *topic_name = g_strdup ("test_topic");
   gchar *str_pipeline = g_strdup_printf (
-      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d ! "
+      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d "
+      "sub-timeout=%" G_GINT64_FORMAT " ! "
       "capsfilter caps=%s ! videoconvert ! videoscale ! fakesink",
-      topic_name, 1, caps_str);
+      topic_name, 1, G_TIME_SPAN_MINUTE, caps_str);
   GError *err = NULL;
   GstElement *pipeline;
   GstStateChangeReturn ret;
@@ -619,9 +622,10 @@ TEST (testMqttSrcWithHelper, srcNormalLaunch1_n)
   gchar *caps_str = g_strdup ("video/x-raw,width=640,height=320,format=RGB");
   gchar *topic_name = g_strdup ("test_topic");
   gchar *str_pipeline = g_strdup_printf (
-      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d ! "
+      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d "
+      "sub-timeout=%" G_GINT64_FORMAT " ! "
       "capsfilter caps=%s ! videoconvert ! videoscale ! fakesink",
-      topic_name, 1, caps_str);
+      topic_name, 1, G_TIME_SPAN_MINUTE, caps_str);
   GError *err = NULL;
   GstElement *pipeline;
   GstStateChangeReturn ret;
@@ -695,9 +699,10 @@ TEST (testMqttSrcWithHelper, srcNormalLaunch2)
   gchar *caps_str = g_strdup ("video/x-raw,width=640,height=320,format=RGB");
   gchar *topic_name = g_strdup ("test_topic");
   gchar *str_pipeline = g_strdup_printf (
-      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d ! "
+      "mqttsrc sub-topic=%s debug=true is-live=true num-buffers=%d "
+      "sub-timeout=%" G_GINT64_FORMAT " ! "
       "capsfilter caps=%s ! videoconvert ! videoscale ! fakesink",
-      topic_name, 1, caps_str);
+      topic_name, 1, G_TIME_SPAN_MINUTE, caps_str);
   GError *err = NULL;
   GstElement *pipeline;
   GstStateChangeReturn ret;