[master] 620740dbf vtc: Stabilize h2 req.body tests
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Fri Jun 16 10:06:15 UTC 2023
commit 620740dbfb2ba38cb67a88aad9723c1b30c87958
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Fri Jun 16 11:58:03 2023 +0200
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
diff --git a/bin/varnishtest/tests/t02019.vtc b/bin/varnishtest/tests/t02019.vtc
index 3adcf2603..6955fcf85 100644
--- a/bin/varnishtest/tests/t02019.vtc
+++ b/bin/varnishtest/tests/t02019.vtc
@@ -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
diff --git a/bin/varnishtest/tests/t02020.vtc b/bin/varnishtest/tests/t02020.vtc
index 6a2ace287..e2bcb76f4 100644
--- a/bin/varnishtest/tests/t02020.vtc
+++ b/bin/varnishtest/tests/t02020.vtc
@@ -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 {
More information about the varnish-commit
mailing list