[libsoup/wip/ci-test] context-test: Be more flexible with asan timeouts



commit ac4a3307d2282a0b5c1405baa63c0a53027f977d
Author: Patrick Griffis <pgriffis igalia com>
Date:   Tue Dec 1 15:02:17 2020 -0600

    context-test: Be more flexible with asan timeouts

 tests/context-test.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/tests/context-test.c b/tests/context-test.c
index d13874ec..aa644c9c 100644
--- a/tests/context-test.c
+++ b/tests/context-test.c
@@ -103,13 +103,21 @@ do_test1 (void)
 static gboolean
 idle_start_test1_thread (gpointer user_data)
 {
-       guint64 time;
+       guint64 time, wait = 5000000;
        GThread *thread;
 
        g_mutex_lock (&test1_mutex);
        thread = g_thread_new ("test1_thread", test1_thread, NULL);
 
-       time = g_get_monotonic_time () + 10000000;
+
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+        /* asan changes the timing so just be more flexible */
+        wait *= 10;
+#endif
+#endif
+
+       time = g_get_monotonic_time () + wait;
        if (g_cond_wait_until (&test1_cond, &test1_mutex, time))
                g_thread_join (thread);
        else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]