[master] 3eeb8c4f5 vtc: Coverage for withdrawn bgfetch

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Feb 28 14:02:05 UTC 2024


commit 3eeb8c4f5014e2abcbc87292b876f40b0b1f09e8
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Wed Feb 28 14:54:09 2024 +0100

    vtc: Coverage for withdrawn bgfetch
    
    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

diff --git a/bin/varnishtest/tests/c00128.vtc b/bin/varnishtest/tests/c00128.vtc
new file mode 100644
index 000000000..e39b1a9cf
--- /dev/null
+++ b/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


More information about the varnish-commit mailing list