varnish-cache
varnish-cache copied to clipboard
varnishadm returns status code 0 if error coincides with timeout
For this change on top of #3845, varnishadm returns with status code 0, despite the vcl init failing:
diff --git a/bin/varnishtest/tests/m00000.vtc b/bin/varnishtest/tests/m00000.vtc
index a5d94aca4..4fbe4e86f 100644
--- a/bin/varnishtest/tests/m00000.vtc
+++ b/bin/varnishtest/tests/m00000.vtc
@@ -177,8 +177,10 @@ shell {
cat >${tmpdir}/f1 <<-EOF
vcl 4.1;
import debug;
+ import vtc;
backend none none;
sub vcl_init {
+ vtc.sleep(10s);
new fails = debug.obj("fail");
}
EOF
the adjusted vtc fails with
** top === shell -exit 1 -expect {failing as requested} {
**** top shell_cmd|exec 2>&1 ;
**** top shell_cmd|\tvarnishadm -n /tmp/vtc.502200.5bf48c88/v1 vcl.load f1 /tmp/vtc.502200.5bf48c88/f1
...
**** top shell_status = 0x0000
---- top shell_exit not as expected: got 0x0000 wanted 0x0001
Also it seems we do not enforce the timeout strictly, if we change that, we should make it longer because (at least in my universe) compilations are not unlikely to take a minute...