Skip to content

Commit

Permalink
Consume less random bits, and don't pace after ramp-up
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdphk committed Feb 8, 2019
1 parent 832d6da commit bef8b6c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/varnishtest/vtc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ start_test(void)
assert(jp->buf != MAP_FAILED);
memset(jp->buf, 0, jp->bufsiz);

VRND_SeedAll();
bprintf(tmpdir, "%s/vtc.%d.%08x", tmppath, (int)getpid(),
(unsigned)random());
AZ(mkdir(tmpdir, 0711));
Expand Down Expand Up @@ -541,6 +540,7 @@ main(int argc, char * const *argv)
{
int ch, i;
int ntest = 1; /* Run tests this many times */
int nstart = 0;
uintmax_t bufsiz;
const char *p;

Expand Down Expand Up @@ -568,6 +568,7 @@ main(int argc, char * const *argv)
if (p != NULL)
vtc_maxdur = atoi(p);

VRND_SeedAll();
setbuf(stdout, NULL);
setbuf(stderr, NULL);
while ((ch = getopt(argc, argv, "b:D:hij:kLln:p:qt:vW")) != -1) {
Expand Down Expand Up @@ -660,7 +661,7 @@ main(int argc, char * const *argv)
start_test();
njob++;
/* Stagger ramp-up */
if (njob < npar)
if (nstart++ < npar)
(void)usleep(random() % 100000L);
i = 1;
continue;
Expand Down

0 comments on commit bef8b6c

Please sign in to comment.