[glib: 7/12] tests/thread-pool-slow: change num-threads limit check




commit 2df5acf60a22696355b403449e0fa23c054fd519
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Fri Oct 14 16:58:13 2022 +0400

    tests/thread-pool-slow: change num-threads limit check
    
    There is no guarantee that the thread pool will reach its limit afaict,
    it depends how the system schedule the various threads. This fixes
    random test failure on win32.
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 glib/tests/thread-pool-slow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/tests/thread-pool-slow.c b/glib/tests/thread-pool-slow.c
index ae16426be1..356464de75 100644
--- a/glib/tests/thread-pool-slow.c
+++ b/glib/tests/thread-pool-slow.c
@@ -291,7 +291,7 @@ test_thread_sort (gboolean sort)
   }
 
   g_assert_cmpint (g_thread_pool_get_max_threads (pool), ==, (gint) max_threads);
-  g_assert_cmpuint (g_thread_pool_get_num_threads (pool), ==,
+  g_assert_cmpuint (g_thread_pool_get_num_threads (pool), <=,
                     (guint) g_thread_pool_get_max_threads (pool));
   g_thread_pool_free (pool, TRUE, TRUE);
 }


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