Hi all,

I found that the bug is because in the tests, the server needs some time
to start in another thread. Makes the tests unstable when machine is slow.

I've made a temporary patch for this to force sleep for 20 seconds after
the server thread starts.

Need to ask the upstream for a proper fix.

The patch is as attachment.

Yours,
Paul
Description: Add sleep for waiting server to start
 Due to some reason, we need to wait the server start and then test.
Author: Ying-Chun Liu (PaulLiu) <paul...@debian.org>
Bug-Debian: https://bugs.debian.org/765107
Last-Update: 2014-10-23

Index: librest-0.7.92/tests/threaded.c
===================================================================
--- librest-0.7.92.orig/tests/threaded.c
+++ librest-0.7.92/tests/threaded.c
@@ -92,6 +92,8 @@ main (int argc, char **argv)
   soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
   g_thread_create ((GThreadFunc)soup_server_run, server, FALSE, NULL);
 
+  sleep(20);
+
   url = g_strdup_printf ("http://127.0.0.1:%d/";, soup_server_get_port (server));
 
   for (i = 0; i < G_N_ELEMENTS (threads); i++) {
Index: librest-0.7.92/tests/custom-serialize.c
===================================================================
--- librest-0.7.92.orig/tests/custom-serialize.c
+++ librest-0.7.92/tests/custom-serialize.c
@@ -125,6 +125,8 @@ main (int argc, char **argv)
   soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
   g_thread_create ((GThreadFunc)soup_server_run, server, FALSE, NULL);
 
+  sleep(20);
+
   url = g_strdup_printf ("http://127.0.0.1:%d/";, soup_server_get_port (server));
 
   proxy = rest_proxy_new (url, FALSE);

Reply via email to