diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-07-22 16:39:02 +0100 |
---|---|---|
committer | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-07-22 16:46:49 +0100 |
commit | 9e8d08de565c5e04b802c015e21ee7573f7746c6 (patch) | |
tree | 17a24cd47582c5392c09e0a115fbd78ba62272b0 /tests | |
parent | 03ae8a519f7d2af7907d7c725c0fdaebce827d19 (diff) | |
download | lorry-9e8d08de565c5e04b802c015e21ee7573f7746c6.tar.gz |
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
<https://bugs.launchpad.net/ubuntu/+source/cvs/+bug/12230>, 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.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/cvs-single-commit.setup | 4 |
1 files changed, 4 insertions, 0 deletions
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 |