Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit ac4f5c9

Browse files
committed
squashme: Harden test case
CCI showed that the test wasn't as bulletproof as I thought. If the second client came in after the first had initiated the fetch, it would not end up on the waitinglist and the VTC would time out.
1 parent 47eeb93 commit ac4f5c9

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

bin/varnishtest/tests/b00083.vtc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
varnishtest "req.ttl = 0s forces cache MISS with request coalescing"
22

33
barrier b1 cond 3 -cyclic
4+
barrier b2 sock 2 -cyclic
45

56
server s1 {
67
rxreq
@@ -16,19 +17,26 @@ server s1 {
1617

1718
varnish v1 -vcl+backend {
1819
import std;
20+
import vtc;
1921

2022
sub vcl_recv {
2123
if (req.http.ttl) {
2224
set req.ttl = std.duration(req.http.ttl, 0s);
2325
}
26+
27+
// Make sure both client tasks are started before the fetch is
28+
// initiated to guarantee that one ends up on the waitinglist.
29+
if (req.http.sync) {
30+
vtc.barrier_sync("${b2_sock}");
31+
}
2432
}
2533
} -start
2634

2735
# c1 and c2 send a request and sync on the barrier only after having received
2836
# headers. This ensures that the two requests are coalesced.
2937

3038
client c1 {
31-
txreq -hdr "ttl: 0s"
39+
txreq -hdr "sync: yes" -hdr "ttl: 0s"
3240
rxresphdrs
3341
expect resp.status == 200
3442
expect resp.http.version == "1"
@@ -38,7 +46,7 @@ client c1 {
3846
} -start
3947

4048
client c2 {
41-
txreq -hdr "ttl: 0s"
49+
txreq -hdr "sync: yes" -hdr "ttl: 0s"
4250
rxresphdrs
4351
expect resp.status == 200
4452
expect resp.http.version == "1"
@@ -69,7 +77,7 @@ client c3 {
6977
# c4 and c5 force a cache MISS, where the two requests are again coalesced.
7078

7179
client c4 {
72-
txreq -hdr "ttl: 0s"
80+
txreq -hdr "sync: yes" -hdr "ttl: 0s"
7381
rxresphdrs
7482
expect resp.status == 200
7583
expect resp.http.version == "2"
@@ -79,7 +87,7 @@ client c4 {
7987
} -start
8088

8189
client c5 {
82-
txreq -hdr "ttl: 0s"
90+
txreq -hdr "sync: yes" -hdr "ttl: 0s"
8391
rxresphdrs
8492
expect resp.status == 200
8593
expect resp.http.version == "2"

0 commit comments

Comments
 (0)