vtest "Test rollback and retry"

# ws_emu triggers #3550
feature !workspace_emulator

server s1 {
	rxreq
	txresp -nolen -hdr "Content-Length: 3"
	expect_close
	accept

	rxreq
	txresp -body xxx
} -start

vinyl v1 -vcl+backend {
	import std;

	sub vcl_backend_response {
		if (bereq.retries == 0) {
			std.rollback(bereq);
		}
	}

	sub vcl_backend_error {
		if (bereq.retries == 0) {
			return (retry);
		}
	}
} -start

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