[master] 0c4a95487 test timeout_linger

Nils Goroll nils.goroll at uplex.de
Wed Apr 24 15:03:07 UTC 2019


commit 0c4a95487f67a1f8270eef3436dbe60f97f0c240
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Apr 24 16:57:53 2019 +0200

    test timeout_linger
    
    see comment in the vtc: For now this test is exploiting some
    implementation detail and we might want to consider adding a VSL for
    waiter involvement.

diff --git a/bin/varnishtest/tests/b00068.vtc b/bin/varnishtest/tests/b00068.vtc
new file mode 100644
index 000000000..afe44c5c4
--- /dev/null
+++ b/bin/varnishtest/tests/b00068.vtc
@@ -0,0 +1,92 @@
+varnishtest "Check timeout_linger"
+
+# XXX this test exploits the fact that the struct waited is
+# left near the free pointer of the session ws when a session
+# made a tour over the waiter
+#
+# Would we want VSL Info about waiter involvement?
+#
+
+varnish v1 -arg "-p timeout_linger=1"	\
+	   -arg "-a 127.0.0.1:0"	\
+	   -arg "-a ${tmpdir}/v1.sock"	\
+	   -vcl {
+	import std;
+	import vtc;
+	import blob;
+
+	backend dummy { .host = "${bad_ip}"; }
+
+	sub vcl_recv {
+		std.log(blob.encode(encoding=HEX,
+		    blob=vtc.workspace_dump(session, f)));
+	}
+	sub vcl_backend_error {
+		set beresp.status = 200;
+		set beresp.ttl = 1h;
+	}
+} -start
+
+logexpect l1 -v v1 -q "vxid == 1001" {
+	expect * 1001 VCL_call {^RECV}
+	expect 0 1001 VCL_Log  "^0{128}$"
+} -start
+
+logexpect l2 -v v1 -q "vxid == 1004" {
+	expect * 1004 VCL_call {^RECV}
+	expect 0 1004 VCL_Log  "^0{128}$"
+} -start
+
+logexpect l3 -v v1 -q "vxid == 1005" {
+	expect * 1005 VCL_call {^RECV}
+	expect 0 1005 VCL_Log  "^0{128}$"
+} -start
+
+logexpect l4 -v v1 -q "vxid == 1006" {
+	expect * 1006 VCL_call {^RECV}
+	expect 0 1006 VCL_Log  "^0{128}$"
+} -start
+
+# requests which made a de-tour over the waiter
+
+logexpect l5 -v v1 -q "vxid == 1007" {
+	expect * 1007 VCL_call {^RECV}
+	expect 0 1007 VCL_Log  "[1-9a-f]"
+} -start
+
+logexpect l6 -v v1 -q "vxid == 1008" {
+	expect * 1008 VCL_call {^RECV}
+	expect 0 1008 VCL_Log  "[1-9a-f]"
+} -start
+
+client c1 {
+	txreq
+	rxresp
+	delay 0.2
+	txreq
+	rxresp
+	delay 1.2
+	txreq
+	rxresp
+} -start
+
+client c1u -connect "${tmpdir}/v1.sock" {
+	txreq
+	rxresp
+	delay 0.2
+	txreq
+	rxresp
+	delay 1.2
+	txreq
+	rxresp
+} -start
+
+client c1 -wait
+client c1u -wait
+
+logexpect l1 -wait
+logexpect l2 -wait
+logexpect l3 -wait
+logexpect l4 -wait
+logexpect l5 -wait
+logexpect l6 -wait


More information about the varnish-commit mailing list