[3.0] 2e50ed1 Don't rely on the test executing fast enough and repeatably enough that two separate timestamps just happen to be the same, just make them the same.

Tollef Fog Heen tfheen at varnish-cache.org
Thu Sep 22 14:03:53 CEST 2011


commit 2e50ed19062cfb5773f63a329f09f56445f6930d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 20 19:15:11 2011 +0000

    Don't rely on the test executing fast enough and repeatably enough that
    two separate timestamps just happen to be the same, just make them
    the same.

diff --git a/bin/varnishtest/tests/r00907.vtc b/bin/varnishtest/tests/r00907.vtc
index 8bbcd2e..b64a160 100644
--- a/bin/varnishtest/tests/r00907.vtc
+++ b/bin/varnishtest/tests/r00907.vtc
@@ -3,7 +3,8 @@ varnishtest "Ticket #907 200/304 handling with Etags + Last-Modified"
 server s1 {
 	rxreq 
 	txresp \
-	       -hdr "ETag: saengei1Ohshicich4iteesu"
+		-hdr "ETag: saengei1Ohshicich4iteesu" \
+		-hdr "Last-Modified: Tue, 20 Sep 2011 18:55:00 GMT"
 } -start
 
 varnish v1 -vcl+backend {
@@ -16,8 +17,15 @@ client c1 {
 	txreq -hdr "If-None-Match: saengei1Ohshicich4iteesu"
 	rxresp
 	expect resp.status == 304
+
 	txreq -hdr "If-None-Match: saengei1Ohshicich4iteesu" \
-	      -hdr "If-Modified-Since: ${date}"
+	      -hdr "If-Modified-Since: Tue, 20 Sep 2011 18:54:59 GMT"
+	rxresp
+	expect resp.status == 200
+
+	txreq -hdr "If-None-Match: saengei1Ohshicich4iteesu" \
+	      -hdr "If-Modified-Since: Tue, 20 Sep 2011 18:55:00 GMT"
 	rxresp
 	expect resp.status == 304
+
 } -run



More information about the varnish-commit mailing list