summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-06-18 12:45:40 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-20 10:46:10 +0200
commit863dd89abf08e67126e4247113b5b27476f5ab03 (patch)
tree8d7ca42eced5d417d6c2c481983db774b7b7c1a2
parent6e0470e0f573b5ccecaa5048d906c1c80239333a (diff)
downloadlibgit2-863dd89abf08e67126e4247113b5b27476f5ab03.tar.gz
tests: tick over five seconds instead of one
When ticking over one second, it can happen that the actual time ticks over the same second between the time that we undermine our own race protections and the time in which we perform the index update. Such timing would make the time in the entries match the index' timestamp and we have not gained anything. Ticking over five seconds makes it so that if real-time rolls over that second, our index is still ahead. This is still suboptimal as we're dealing with timing, but five seconds should be long enough for any reasonable test runner to finish the tests.
-rw-r--r--tests/checkout/checkout_helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/checkout/checkout_helpers.c b/tests/checkout/checkout_helpers.c
index 42ed1db2a..92a454d12 100644
--- a/tests/checkout/checkout_helpers.c
+++ b/tests/checkout/checkout_helpers.c
@@ -143,7 +143,7 @@ void tick_index(git_index *index)
times[0].tv_sec = ts;
times[0].tv_usec = 0;
- times[1].tv_sec = ts + 1;
+ times[1].tv_sec = ts + 5;
times[1].tv_usec = 0;
cl_git_pass(p_utimes(git_index_path(index), times));