netclientclock: test: add delay under valgrind to free clock from cache

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9115>
This commit is contained in:
Doug Nazar 2025-05-28 08:25:45 -04:00 committed by GStreamer Marge Bot
parent c5b9e5dcd5
commit 50208d6064
2 changed files with 23 additions and 0 deletions

View File

@ -22,6 +22,10 @@
#include "config.h"
#endif
#ifdef HAVE_VALGRIND
# include <valgrind/valgrind.h>
#endif
#include <gst/check/gstcheck.h>
#include <gst/net/gstnet.h>
@ -43,6 +47,13 @@ GST_START_TEST (test_instantiation)
ASSERT_OBJECT_REFCOUNT (local, "system clock", 2);
gst_object_unref (local);
#ifdef HAVE_VALGRIND
if (RUNNING_ON_VALGRIND) {
// Delay 60+ to allow cache to free clocks
g_usleep (65 * G_USEC_PER_SEC);
}
#endif
}
GST_END_TEST;
@ -114,6 +125,13 @@ GST_START_TEST (test_functioning)
gst_object_unref (client);
gst_object_unref (server);
#ifdef HAVE_VALGRIND
if (RUNNING_ON_VALGRIND) {
// Delay 60+ to allow cache to free clocks
g_usleep (65 * G_USEC_PER_SEC);
}
#endif
}
GST_END_TEST;

View File

@ -1,5 +1,10 @@
have_debug = true # FIXME
valgrind_dep = dependency('valgrind', required: false).partial_dependency(compile_args : true)
if valgrind_dep.found()
cdata.set('HAVE_VALGRIND', 1)
endif
# tests and condition when to skip the test
core_tests = [
[ 'gst/gst.c', not gst_registry ],