[master] 6d76ccd 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.

Poul-Henning Kamp phk at varnish-cache.org
Tue Sep 20 21:16:01 CEST 2011


commit 6d76ccd9fbd3b5022e5d55ae1779b7ea33f0365d
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