[master] bef8b6cf0 Consume less random bits, and don't pace after ramp-up

Poul-Henning Kamp phk at FreeBSD.org
Fri Feb 8 10:24:08 UTC 2019


commit bef8b6cf0f1a8887484f1bbaba660478444d206e
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 4b7fe2a4a..ac6c98ec4 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -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));
@@ -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;
 
@@ -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) {
@@ -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;


More information about the varnish-commit mailing list