tests: fix hidden repeatability problem with age filter test
authorMatt Mackall <mpm@selenic.com>
Tue, 12 May 2015 12:33:42 -0500
changeset 25005 5ddbb024c2e9
parent 25004 e264d4c9629b
child 25006 517763f87141
tests: fix hidden repeatability problem with age filter test This test was corrupting later cases in mysterious ways because the hash of the changeset was changing every day at midnight. This made it hard to figure out why tests were consistently breaking after they were consistently working.
tests/test-command-template.t
--- a/tests/test-command-template.t	Sat May 02 15:51:57 2015 +0900
+++ b/tests/test-command-template.t	Tue May 12 12:33:42 2015 -0500
@@ -1938,6 +1938,8 @@
 
 Age filter:
 
+  $ hg init unstable-hash
+  $ cd unstable-hash
   $ hg log --template '{date|age}\n' > /dev/null || exit 1
 
   >>> from datetime import datetime, timedelta
@@ -1951,6 +1953,15 @@
   $ hg log -l1 --template '{date|age}\n'
   7 years from now
 
+  $ cd ..
+  $ rm -rf unstable-hash
+
+Add a dummy commit to make up for the instability of the above:
+
+  $ echo a > a
+  $ hg add a
+  $ hg ci -m future
+
 Count filter:
 
   $ hg log -l1 --template '{node|count} {node|short|count}\n'