vtest "retry in vcl_backend_error"

vinyl v1 -vcl {

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

	sub vcl_backend_error {
		return (retry);
	}

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

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

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

vinyl v1 -expect backend_fail == 3
vinyl v1 -expect fetch_failed == 3
