tests: element: Don't run too many loop
authorSeungha Yang <seungha@centricular.com>
Mon, 14 Sep 2020 19:24:20 +0000 (04:24 +0900)
committerSeungha Yang <seungha@centricular.com>
Mon, 14 Sep 2020 19:41:19 +0000 (04:41 +0900)
g_thread_yield() doesn't ensure thread switching actually.
It would result to adding so many pads. Depending on system,
timeout might happen then.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/625>

tests/check/gst/gstelement.c

index 62d469c..9c96244 100644 (file)
@@ -870,7 +870,7 @@ GST_START_TEST (test_foreach_pad)
   MAIN_START_THREAD_FUNCTION (0, thread_add_remove_pads, e);
   MAIN_SYNCHRONIZE ();
 
-  for (i = 0; i < 10000; ++i) {
+  for (i = 0; i < 1000; ++i) {
     gchar num[32];
 
     g_snprintf (num, 32, "foreach-test-%u", i);