tests: de-flake test-narrow-share.t by making dirstate predictable
test-narrow-share.t was sometimes (~0.5% on my machine) failing like this:
@@ -61,7 +61,7 @@
A d3/g
$ hg -R main debugdirstate --no-dates
n 644 2 set d1/f
- n 644 2 unset d3/f
+ n 644 2 set d3/f
a 0 -1 unset d3/g
n 644 2 set d5/f
n 644 2 set d7/f
The timestamp for d3/f would get set if it was determined at some
point that it was clean. That check is usually done when the user runs
`hg st`. We don't do that before the failure in the test case, but it
happens at the end of the `hg clone` call. So if the file system's
time happens to roll over after the clone's working copy has been
written, but before its (final) dirstate has been written, we can end
up with a set timestamp there.
This patch makes it consistent by sleeping for 2 seconds so the
timestamp gets reliably set.
Differential Revision: https://phab.mercurial-scm.org/D5568
Our full contribution guidelines are in our wiki, please see:
https://www.mercurial-scm.org/wiki/ContributingChanges
If you just want a checklist to follow, you can go straight to
https://www.mercurial-scm.org/wiki/ContributingChanges#Submission_checklist
If you can't run the entire testsuite for some reason (it can be
difficult on Windows), please at least run `contrib/check-code.py` on
any files you've modified and run `python contrib/check-commit` on any
commits you've made (for example, `python contrib/check-commit
273ce12ad8f1` will report some style violations on a very old commit).