summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/torture.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index c928846f1f..f54483ae45 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -3607,9 +3607,6 @@ BOOL torture_chkpath_test(int dummy)
return ret;
}
-
-
-
static BOOL run_dirtest1(int dummy)
{
int i;
@@ -3766,6 +3763,7 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
volatile BOOL *child_status_out;
int synccount;
int tries = 8;
+ double start_time_limit = 10 + (nprocs * 0.5);
synccount = 0;
@@ -3805,12 +3803,18 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
printf("pid %d failed to start\n", (int)getpid());
_exit(1);
}
- msleep(10);
+ msleep(100);
}
child_status[i] = getpid();
- while (child_status[i] && end_timer() < 5) msleep(2);
+ while (child_status[i] && end_timer() < start_time_limit) msleep(2);
+
+ if (child_status[i]) {
+ printf("Child %d failed to start!\n", i);
+ child_status_out[i] = 1;
+ _exit(1);
+ }
child_status_out[i] = fn(i);
_exit(0);
@@ -3823,8 +3827,8 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
if (child_status[i]) synccount++;
}
if (synccount == nprocs) break;
- msleep(10);
- } while (end_timer() < 30);
+ msleep(100);
+ } while (end_timer() < start_time_limit);
if (synccount != nprocs) {
printf("FAILED TO START %d CLIENTS (started %d)\n", nprocs, synccount);
@@ -3832,6 +3836,8 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
return end_timer();
}
+ printf("Starting %d clients\n", nprocs);
+
/* start the client load */
start_timer();
@@ -3842,7 +3848,11 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
printf("%d clients started\n", nprocs);
for (i=0;i<nprocs;i++) {
- while (waitpid(0, &status, 0) == -1 && errno == EINTR) /* noop */ ;
+ int ret;
+ while ((ret=waitpid(0, &status, 0)) == -1 && errno == EINTR) /* noop */ ;
+ if (ret == -1 || WEXITSTATUS(status) != 0) {
+ *result = False;
+ }
}
printf("\n");