aboutsummaryrefslogtreecommitdiff
path: root/src/bank-lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/bank-lib')
-rw-r--r--src/bank-lib/test_bank_api.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c
index b9b9eae5a..232900f20 100644
--- a/src/bank-lib/test_bank_api.c
+++ b/src/bank-lib/test_bank_api.c
@@ -510,6 +510,7 @@ main (int argc,
char * const *argv)
{
struct GNUNET_OS_Process *bankd;
+ unsigned int cnt;
GNUNET_log_setup ("test-bank-api",
"WARNING",
@@ -530,19 +531,30 @@ main (int argc,
/* give child time to start and bind against the socket */
fprintf (stderr,
"Waiting for taler-bank-manage to be ready");
+ cnt = 0;
do
{
fprintf (stderr, ".");
sleep (1);
+ cnt++;
+ if (cnt > 30)
+ break;
}
while (0 != system ("wget -q -t 1 -T 1 http://127.0.0.1:8081/ -o /dev/null -O /dev/null"));
fprintf (stderr, "\n");
result = GNUNET_SYSERR;
- GNUNET_SCHEDULER_run (&run, NULL);
+ if (cnt <= 30)
+ GNUNET_SCHEDULER_run (&run, NULL);
GNUNET_OS_process_kill (bankd,
SIGTERM);
GNUNET_OS_process_wait (bankd);
GNUNET_OS_process_destroy (bankd);
+ if (cnt > 30)
+ {
+ fprintf (stderr,
+ "taler-bank-manage failed to start properly.\n");
+ return 77;
+ }
return (GNUNET_OK == result) ? 0 : 1;
}