Commit f697e673 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Try to firm up v00010 even more, by explicitly waiting for the

crashing child to do so, and then explicitly start it again.
parent 98f1c8c7
......@@ -27,9 +27,6 @@ varnish v1 -cliok "param.set diag_bitmap 0x00001000"
# Force the (random) port selected to be used again after restart.
varnish v1 -cliok "param.set listen_address ${v1_addr}:${v1_port}"
# varnishtest defaults to auto_restart off, to avoid masking bugs.
varnish v1 -cliok "param.set auto_restart on"
client c1 {
txreq -url "/"
rxresp
......@@ -37,6 +34,11 @@ client c1 {
# Don't expect answer, the server crashed.
} -run
varnish v1 -wait-stopped
varnish v1 -cliok "panic.show"
varnish v1 -cliok "panic.clear"
varnish v1 -clierr 300 "panic.clear"
varnish v1 -cliok "start"
varnish v1 -wait-running
sema r1 sync 2
......@@ -45,7 +47,3 @@ client c1 {
rxresp
expect resp.http.foo == "foo"
} -run
varnish v1 -cliok "panic.show"
varnish v1 -cliok "panic.clear"
varnish v1 -clierr 300 "panic.clear"
......@@ -119,6 +119,30 @@ varnish_ask_cli(const struct varnish *v, const char *cmd, char **repl)
return ((enum VCLI_status_e)retval);
}
/**********************************************************************
*
*/
static void
wait_stopped(const struct varnish *v)
{
char *r;
enum VCLI_status_e st;
while (1) {
vtc_log(v->vl, 3, "wait-stopped");
st = varnish_ask_cli(v, "status", &r);
if (st != CLIS_OK)
vtc_log(v->vl, 0,
"CLI status command failed: %u %s", st, r);
if (!strcmp(r, "Child in state stopped")) {
free(r);
break;
}
free(r);
(void)usleep(200000);
}
}
/**********************************************************************
*
*/
......@@ -130,6 +154,7 @@ wait_running(const struct varnish *v)
enum VCLI_status_e st;
while (1) {
vtc_log(v->vl, 3, "wait-running");
st = varnish_ask_cli(v, "status", &r);
if (st != CLIS_OK)
vtc_log(v->vl, 0,
......@@ -840,6 +865,10 @@ cmd_varnish(CMD_ARGS)
varnish_stop(v);
continue;
}
if (!strcmp(*av, "-wait-stopped")) {
wait_stopped(v);
continue;
}
if (!strcmp(*av, "-wait-running")) {
wait_running(v);
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment