Commit 620740db authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vtc: Stabilize h2 req.body tests

With the recent change to stream the request body to the backend like
chunked encoding does, even when we know the content length, two test
cases became sensitive to the timing of window updates. The data frames
contain for the most part a 16kB payload, which happens to be the same
as fetch_chunksize's default value.

With a value of 64kB, corresponding to one more byte than the default h2
initial window, we are garanteed to never risk a race between the VFP
consuming the h2_rxbuf and the h2_sess task monitoring it to send window
updates.

This is also a good occasion to exercise stream.peer_window in t02019.

Refs #3878
Refs #3934
parent d4255aa1
......@@ -15,6 +15,7 @@ varnish v1 -vcl+backend {
}
} -start
varnish v1 -cliok "param.set fetch_chunksize 64k"
varnish v1 -cliok "param.set feature +http2"
varnish v1 -cliok "param.reset h2_initial_window_size"
varnish v1 -cliok "param.reset h2_rx_window_low_water"
......@@ -22,21 +23,35 @@ varnish v1 -cliok "param.reset h2_rx_window_low_water"
client c1 {
stream 1 {
txreq -req POST -url /1 -hdr "content-length" "131072" -nostrend
expect stream.peer_window == 65535
txdata -datalen 16384 -nostrend
txdata -datalen 16384 -nostrend
txdata -datalen 16384 -nostrend
txdata -datalen 16383 -nostrend
expect stream.peer_window == 0
barrier b1 sync
rxwinup
expect stream.peer_window == 65535
txdata -datalen 16384 -nostrend
rxwinup
expect stream.peer_window == 65535
txdata -datalen 16384 -nostrend
rxwinup
expect stream.peer_window == 65535
txdata -datalen 16384 -nostrend
rxwinup
expect stream.peer_window == 65535
txdata -datalen 16384 -nostrend
rxwinup
expect stream.peer_window == 65535
txdata -datalen 1
rxresp
expect resp.status == 200
} -run
......
......@@ -4,7 +4,7 @@ barrier b1 sock 3
server s1 {
rxreq
expect req.url == /1
expect req.url == "/1"
expect req.body == abcde
txresp
rxreq
......@@ -14,6 +14,7 @@ server s1 {
expect req.body == a
} -start
varnish v1 -cliok "param.set fetch_chunksize 64k"
varnish v1 -vcl+backend {
import vtc;
sub vcl_recv {
......
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