Commit 0c4a9548 authored by Nils Goroll's avatar Nils Goroll

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.
parent 0da95926
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment