qa: various fix to tests

This commit is contained in:
2017-08-11 02:01:55 +02:00
parent 93dde48355
commit 1c4a04cd30
21 changed files with 253 additions and 60 deletions

View File

@ -72,7 +72,7 @@ handletimeout(void *v, char *s)
if(strcmp(s, "timedout") == 0){
if(verbose)
print("%d: noted: %s\n", getpid(), s);
print("FAIL: timedout\n");
print("FAIL: %s timedout\n", argv0);
// printdebugrendezvouslogs();
exits("FAIL");
}
@ -130,15 +130,17 @@ sleeper(int index)
return end != start ? nil : "FAIL";
}
int lastspawn;
void
spawnsleeper(int index)
{
int pid;
int pid, ls = lastspawn;
char * res;
switch((pid = rfork(RFMEM|RFPROC|RFNOWAIT)))
{
case 0:
++lastspawn;
res = sleeper(index);
exits(res);
break;
@ -147,6 +149,8 @@ spawnsleeper(int index)
exits("rfork fails");
break;
default:
while(ls == lastspawn)
;
if(verbose)
print("spawn sleeper %d\n", pid);
break;
@ -154,11 +158,14 @@ spawnsleeper(int index)
}
void
main(void)
main(int argc, char* argv[])
{
int i;
int64_t average;
ARGBEGIN{
}ARGEND;
rfork(RFNOTEG|RFREND);
rStart.l = &rl;
rCompleted.l = &rl;
@ -213,6 +220,6 @@ main(void)
print("PASS\n");
exits("PASS");
}
print("FAIL: average timeout too long %lld ms\n", average);
print("FAIL: %s: average timeout too long %lld ms\n", argv0, average);
exits("FAIL");
}