[4.1] dceb4cf Make sure that oc->last_lru has sufficient precision

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Wed Feb 14 14:45:17 UTC 2018


commit dceb4cf6379e99255ca38a79c4f65f20230b1174
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Jan 8 16:05:05 2018 +0100

    Make sure that oc->last_lru has sufficient precision
    
    Since the last_lru tracks epoch time, it needs the double precision
    floating point type to accurately track the time.
    
    This is simply the test case from 2261dcfd545e6c9a5d60000cce06e993.

diff --git a/bin/varnishtest/tests/r02527.vtc b/bin/varnishtest/tests/r02527.vtc
new file mode 100644
index 0000000..ae8ed03
--- /dev/null
+++ b/bin/varnishtest/tests/r02527.vtc
@@ -0,0 +1,30 @@
+varnishtest "Test the n_lru_moved counter"
+
+server s1 {
+	rxreq
+	txresp
+} -start
+
+varnish v1 -arg "-p lru_interval=1" -vcl+backend {
+	sub vcl_backend_response {
+		set beresp.do_stream = false;
+	}
+} -start
+
+client c1 {
+	txreq
+	rxresp
+} -run
+
+varnish v1 -expect MAIN.n_lru_moved == 0
+
+delay 1
+
+client c1 {
+	txreq
+	rxresp
+	txreq
+	rxresp
+} -run
+
+varnish v1 -expect MAIN.n_lru_moved == 1


More information about the varnish-commit mailing list