Hi,
phk has added parallelism to varnishtest, which is cool for those of us who live
on larger SMPs (-j option).
Running first tests with -j, I noticed that some hardcoded timeouts expire much
more easily when fully loading a machine, so as a first, very simplistic
approach, I've changed those timeout to scale with the number of parallel jobs.
But timeouts in varnishtest will probably need to be revisited.
Nils
Index: vtc_http.c
===================================================================
--- vtc_http.c (revision 5518)
+++ vtc_http.c (working copy)
@@ -51,6 +51,8 @@
#define MAX_HDR 50
+extern int npar;
+
struct http {
unsigned magic;
#define HTTP_MAGIC 0x2f02169c
@@ -822,7 +824,7 @@
fds[0].fd = hp->fd;
fds[0].events = POLLIN | POLLHUP | POLLERR;
fds[0].revents = 0;
- i = poll(fds, 1, 1000);
+ i = poll(fds, 1, 1000 * npar);
if (i == 0)
vtc_log(vl, 0, "Expected close: timeout");
if (i != 1 || !(fds[0].revents & POLLIN))
Index: vtc_main.c
===================================================================
--- vtc_main.c (revision 5518)
+++ vtc_main.c (working copy)
@@ -78,7 +78,7 @@
static VTAILQ_HEAD(, vtc_tst) tst_head = VTAILQ_HEAD_INITIALIZER(tst_head);
static struct vev_base *vb;
static int njob = 0;
-static int npar = 1; /* Number of parallel tests */
+int npar = 1; /* Number of parallel tests */
static unsigned vtc_maxdur = 30; /* Max duration of any test */
static int vtc_continue; /* Continue on error */
static int vtc_verbosity = 1; /* Verbosity Level */
Index: vtc_varnish.c
===================================================================
--- vtc_varnish.c (revision 5518)
+++ vtc_varnish.c (working copy)
@@ -83,6 +83,8 @@
static VTAILQ_HEAD(, varnish) varnishes =
VTAILQ_HEAD_INITIALIZER(varnishes);
+extern int npar;
+
/**********************************************************************
* Ask a question over CLI
*/
@@ -229,7 +231,7 @@
memset(fds, 0, sizeof fds);
fds->fd = v->fds[0];
fds->events = POLLIN;
- i = poll(fds, 1, 1000);
+ i = poll(fds, 1, 1000 * npar);
if (i == 0)
continue;
if (fds->revents & (POLLERR|POLLHUP))
@@ -315,7 +317,7 @@
/* Wait for the varnish to call home */
fd.fd = v->cli_fd;
fd.events = POLLIN;
- i = poll(&fd, 1, 10000);
+ i = poll(&fd, 1, 10000 * npar);
if (i != 1) {
AZ(close(v->fds[1]));
(void)kill(v->pid, SIGKILL);
_______________________________________________
varnish-dev mailing list
[email protected]
http://lists.varnish-cache.org/mailman/listinfo/varnish-dev