Skip to content

Commit

Permalink
vtc: Coverage for withdrawn bgfetch
Browse files Browse the repository at this point in the history
This adds coverage for a non-delivery transition from vcl_hit, where the
busy objcore would drop its sole reference in the event of a grace hit.
The lack of coverage was visible in the gcov dashboard:

    669   580   if (busy != NULL) {
    670   0     	(void)HSH_DerefObjCore(wrk, &busy, 0);
    671   0     	VRY_Clear(req);
    672   0     }

There should now be at least one pass inside this block.

Refs #4032
  • Loading branch information
Dridi committed Feb 28, 2024
1 parent 4741f40 commit 3eeb8c4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions bin/varnishtest/tests/c00128.vtc
@@ -0,0 +1,29 @@
varnishtest "Withdraw graced hit's busy objcore"

server s1 {
rxreq
txresp
} -start

varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.ttl = 1ms;
}
sub vcl_hit {
if (obj.ttl < 0s) {
return (fail);
}
}
} -start

client c1 {
txreq
rxresp
expect resp.status == 200

delay 0.01

txreq
rxresp
expect resp.status == 503
} -run

0 comments on commit 3eeb8c4

Please sign in to comment.