varnishtest "retry in vcl_backend_error"

varnish v1 -vcl {

	backend b1 { .host = "${bad_backend}"; }

	sub vcl_backend_error {
		return (retry);
	}

	sub vcl_synth {
		set resp.status = 504;
	}
} -start

varnish v1 -cliok "param.set debug +syncvsl"
varnish v1 -cliok "param.set connect_timeout 1"
varnish v1 -cliok "param.set max_retries 2"

client c1 {
	txreq
	rxresp
	expect resp.status == 504
} -run

varnish v1 -expect backend_fail == 3
varnish v1 -expect fetch_failed == 3
