From 4753aca2279239614595f90bab0729de1e6150b0 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 17 Jun 2008 20:27:31 +0000 Subject: [PATCH] Automatically wait for servers and clients during reset pass. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2730 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishtest/t001.vtc | 28 ++++++++++------------ varnish-cache/bin/varnishtest/vtc_client.c | 2 ++ varnish-cache/bin/varnishtest/vtc_server.c | 2 ++ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/varnish-cache/bin/varnishtest/t001.vtc b/varnish-cache/bin/varnishtest/t001.vtc index a55d2d11..a030c1bd 100644 --- a/varnish-cache/bin/varnishtest/t001.vtc +++ b/varnish-cache/bin/varnishtest/t001.vtc @@ -2,20 +2,6 @@ # # $Id$ -varnish v1 -launch - -varnish v1 -vcl { - backend s1 { - .host = "localhost"; - .port = "9080"; - } - sub vcl_recv { - pipe; - } -} - -varnish v1 -start - server s1 -repeat 1 { rxreq txresp \ @@ -25,6 +11,16 @@ server s1 -repeat 1 { -body "012345\n" } +varnish v1 -launch + +varnish v1 -vcl+backend { + sub vcl_recv { + pipe; + } +} + +varnish v1 -start + server s1 -start client c1 { @@ -35,6 +31,6 @@ client c1 { client c1 -run -server s1 -wait +# server s1 -wait -varnish v1 -stop +# varnish v1 -wait diff --git a/varnish-cache/bin/varnishtest/vtc_client.c b/varnish-cache/bin/varnishtest/vtc_client.c index 725f4858..cb33dc7a 100644 --- a/varnish-cache/bin/varnishtest/vtc_client.c +++ b/varnish-cache/bin/varnishtest/vtc_client.c @@ -167,6 +167,8 @@ cmd_client(char **av, void *priv) /* Reset and free */ VTAILQ_FOREACH_SAFE(c, &clients, list, c2) { VTAILQ_REMOVE(&clients, c, list); + if (c->tp != NULL) + client_wait(c); FREE_OBJ(c); /* XXX: MEMLEAK */ } diff --git a/varnish-cache/bin/varnishtest/vtc_server.c b/varnish-cache/bin/varnishtest/vtc_server.c index 460538f6..3d9afbfa 100644 --- a/varnish-cache/bin/varnishtest/vtc_server.c +++ b/varnish-cache/bin/varnishtest/vtc_server.c @@ -209,6 +209,8 @@ cmd_server(char **av, void *priv) /* Reset and free */ VTAILQ_FOREACH_SAFE(s, &servers, list, s2) { VTAILQ_REMOVE(&servers, s, list); + if (s->sock >= 0) + server_wait(s); FREE_OBJ(s); /* XXX: MEMLEAK */ } -- 2.39.5