vtest "Check workspace overflow in fetch processor"

server s1 {
	rxreq
	txresp -bodylen 1024
} -start


vinyl v1 -vcl+backend {
	import vtc;

	sub vcl_backend_response {
		set beresp.do_gzip = true;
		vtc.workspace_alloc(backend, vtc.workspace_free(backend) - 16);
	}
} -start

logexpect l1 -v v1 -g raw {
	expect * 1002 FetchError {^Workspace overflow}
	expect * =    Error      {^out of workspace [(]bo[)]}
} -start

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

logexpect l1 -wait
vinyl v1 -expect ws_backend_overflow == 1
