[master] b9c5cb57b Improve workspace overflow test
Nils Goroll
nils.goroll at uplex.de
Mon Jan 27 16:36:06 UTC 2020
commit b9c5cb57b3ffc5be93fc9d179da948681204a113
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Jan 27 17:34:37 2020 +0100
Improve workspace overflow test
Ref #3194
diff --git a/bin/varnishtest/tests/c00071.vtc b/bin/varnishtest/tests/c00071.vtc
index 7e3c156ee..9142f382a 100644
--- a/bin/varnishtest/tests/c00071.vtc
+++ b/bin/varnishtest/tests/c00071.vtc
@@ -13,6 +13,7 @@ server s1 {
varnish v1 -vcl+backend {
import vtc;
+ import std;
sub vcl_deliver {
vtc.workspace_alloc(client, -192);
@@ -21,7 +22,8 @@ varnish v1 -vcl+backend {
vtc.workspace_alloc(client, -10);
}
else if (req.url ~ "/baz") {
- set resp.http.x-foo = regsub(req.url, "baz", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz");
+ set resp.http.x-foo = regsub(req.url, "baz", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz");
+ std.log("dummy");
}
set resp.http.x-of = vtc.workspace_overflowed(client);
}
@@ -41,6 +43,16 @@ client c1 {
varnish v1 -vsl_catchup
+logexpect l1 -v v1 -g raw {
+ expect * 1006 VCL_call {^DELIVER$}
+ expect 0 = LostHeader {^x-foo:$}
+ # std.log does not need workspace
+ expect 0 = VCL_Log {^dummy$}
+ # the workspace is overflowed, but still has space
+ expect 0 = RespHeader {^x-of: true$}
+ expect 6 = Error {^workspace_client overflow}
+} -start
+
client c2 {
txreq -url /baz
rxresp
@@ -48,6 +60,7 @@ client c2 {
expect resp.http.x-of == <undef>
} -run
+logexpect l1 -wait
varnish v1 -expect client_resp_500 == 2
varnish v1 -expect ws_client_overflow == 2
More information about the varnish-commit
mailing list