mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-12 18:55:12 +01:00
tests: Skip a hard-to-reproduce race in reference tests under valgrind
Fixes test timeouts like this one: https://gitlab.gnome.org/GNOME/glib/-/jobs/4827270 The race will continue to be reproduced when running the tests not under valgrind. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
84f555a3aa
commit
4d566e47d7
@ -1,5 +1,7 @@
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "gvalgrind.h"
|
||||
|
||||
static void
|
||||
test_fundamentals (void)
|
||||
{
|
||||
@ -952,6 +954,16 @@ test_weak_ref_concurrent (gconstpointer testdata)
|
||||
ConcurrentThreadData thread_data[CONCURRENT_N_THREADS];
|
||||
GWeakRef weak_ref = { 0 };
|
||||
|
||||
/* The race in this test is very hard to reproduce under valgrind, so skip it.
|
||||
* Otherwise the test can run for tens of minutes. */
|
||||
#if defined (ENABLE_VALGRIND)
|
||||
if (RUNNING_ON_VALGRIND)
|
||||
{
|
||||
g_test_skip ("Skipping hard-to-reproduce race under valgrind");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Let several threads call g_weak_ref_set() & g_weak_ref_get() in a loop. */
|
||||
|
||||
for (i = 0; i < CONCURRENT_N_OBJS; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user