tests: ensure a status will have non ambiguous mtime in some race test
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 23 Nov 2021 16:32:56 +0100
changeset 48375 4c61c7f75de6
parent 48374 a4a5d123fb03
child 48376 ad5a64473840
tests: ensure a status will have non ambiguous mtime in some race test For the test to work, we need some mtime to be recorded. For them to be recorded, they need to be "clearly in the past", otherwise edit with the same mtime would be possible. Strictly speaking there might be file system with a minimal mtime increment longer than one second. However it is unlikely that we will run the test on them for now. We can be smarter about this in the future if it becomes necessary. Differential Revision: https://phab.mercurial-scm.org/D11779
tests/test-dirstate-race.t
--- a/tests/test-dirstate-race.t	Thu Nov 18 00:08:57 2021 +0100
+++ b/tests/test-dirstate-race.t	Tue Nov 23 16:32:56 2021 +0100
@@ -89,6 +89,7 @@
   > rm b && rm -r dir1 && rm d && mkdir d && rm e && mkdir e
   > EOF
 
+  $ sleep 1 # ensure non-ambiguous mtime
   $ hg status --config extensions.dirstaterace=$TESTTMP/dirstaterace.py
   M d
   M e