From 9e8d08de565c5e04b802c015e21ee7573f7746c6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 22 Jul 2020 16:39:02 +0100 Subject: tests: Fix flaky cvs-single-commit test The cvs-single-commit test actually involves two commits: one made by 'cvs init', and another by 'cvs commit'. Occasionally these commit appear in the wrong order in the git repository, apparently because they ended up with the same timestamp. This seems to be a similar issue to , which has a workaround (a 20 ms sleep after checkout). However, this issue is not readily reproducible - I had to use libfaketime to do it - and I can't tell whether that will work for us. Instead, add a 1 second sleep after checkout. Closes #6. --- tests/cvs-single-commit.setup | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/cvs-single-commit.setup b/tests/cvs-single-commit.setup index 537de81..1f0ef43 100755 --- a/tests/cvs-single-commit.setup +++ b/tests/cvs-single-commit.setup @@ -38,6 +38,10 @@ cd "$workingcopy" cvs checkout CVSROOT cd "$workingcopy/CVSROOT" +# ensure that our commit has a later timestamp than cvs init's +# "initial checkin" +sleep 1 + # add the test file echo "first line" > test.txt cvs -Q add test.txt -- cgit v1.2.1