From 30cd4ffedc991a35b84ed2c84f5a74b5b2d7322b Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Tue, 27 Apr 2010 10:48:50 +0000 Subject: less stressful testcases for slow machines (especially a certain sparc buildot) --- src/testing/test_testing_connect.c | 2 +- src/testing/test_testing_group.c | 16 ++++++++++++---- src/testing/test_testing_topology.c | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/testing/test_testing_connect.c b/src/testing/test_testing_connect.c index 60721298e..9dd07f993 100644 --- a/src/testing/test_testing_connect.c +++ b/src/testing/test_testing_connect.c @@ -24,7 +24,7 @@ #include "platform.h" #include "gnunet_testing_lib.h" -#define VERBOSE GNUNET_NO +#define VERBOSE GNUNET_YES /** diff --git a/src/testing/test_testing_group.c b/src/testing/test_testing_group.c index 1f21b64f4..61ef82449 100644 --- a/src/testing/test_testing_group.c +++ b/src/testing/test_testing_group.c @@ -24,13 +24,14 @@ #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); diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index 334f1c78d..eae59913c 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c @@ -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--; -- cgit v1.2.3