less stressful testcases for slow machines (especially a certain sparc buildot)
authorNathan S. Evans <evans@in.tum.de>
Tue, 27 Apr 2010 10:48:50 +0000 (10:48 +0000)
committerNathan S. Evans <evans@in.tum.de>
Tue, 27 Apr 2010 10:48:50 +0000 (10:48 +0000)
src/testing/test_testing_connect.c
src/testing/test_testing_group.c
src/testing/test_testing_topology.c

index 60721298e2196b40c2cfb25a562a3964dce6a3ae..9dd07f993bc5a43ac51dc5293f38046ddd92c298 100644 (file)
@@ -24,7 +24,7 @@
 #include "platform.h"
 #include "gnunet_testing_lib.h"
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
 
 
 /**
index 1f21b64f43aa869e24e77654bf81b0b211c7659c..61ef82449c1e3b2648f1584e4072399368e0083e 100644 (file)
 #include "platform.h"
 #include "gnunet_testing_lib.h"
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
 
+#define NUM_PEERS 4
 
 /**
  * How long until we give up on connecting the peers?
  */
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
 
 
 static int ok;
@@ -48,10 +49,17 @@ my_cb (void *cls,
        const struct GNUNET_CONFIGURATION_Handle *cfg,
        struct GNUNET_TESTING_Daemon *d, const char *emsg)
 {
-  GNUNET_assert (id != NULL);
+  if (id == NULL)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start callback called with error (too long starting peers), aborting test!\n");
+      GNUNET_TESTING_daemons_stop (pg);
+      ok = 7;
+    }
   peers_left--;
   if (peers_left == 0)
     {
+      sleep(2); /* Give other services a chance to initialize before killing */
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers started successfully, ending test!\n");
       GNUNET_TESTING_daemons_stop (pg);
       ok = 0;
     }
@@ -69,7 +77,7 @@ run (void *cls,
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n");
 #endif
-  peers_left = 8;
+  peers_left = NUM_PEERS;
   pg = GNUNET_TESTING_daemons_start (sched, cfg,
                                      peers_left,
                                      &my_cb, NULL, NULL, NULL, NULL);
index 334f1c78dc0b03b3f73d0b2ac917a1699e93e073..eae59913c4c53494a60e0fc1abf5be4c05271c64 100644 (file)
@@ -57,7 +57,7 @@ static unsigned int expected_messages;
 
 static unsigned int expected_connections;
 
-static int peers_left;
+static unsigned long long peers_left;
 
 static struct GNUNET_TESTING_PeerGroup *pg;
 
@@ -524,7 +524,7 @@ my_cb (void *cls,
 {
   GNUNET_assert (id != NULL);
 #if VERBOSE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %d out of %d\n",
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n",
               (num_peers - peers_left) + 1, num_peers);
 #endif
   peers_left--;