[6.0] 6cc5e3cdb Consume less random bits, and don't pace after ramp-up
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Wed Oct 18 09:21:05 UTC 2023
commit 6cc5e3cdb55ed3096c77991b29dd810d4627b866
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Fri Feb 8 10:01:42 2019 +0000
Consume less random bits, and don't pace after ramp-up
diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index 516ff99c4..52ba8ba6b 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -277,7 +277,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));
@@ -538,6 +537,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;
char buf[PATH_MAX];
@@ -566,6 +566,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) {
@@ -658,7 +659,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;
More information about the varnish-commit
mailing list