Commit 863dd89a by Carlos Martín Nieto

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.
parent 6e0470e0
...@@ -143,7 +143,7 @@ void tick_index(git_index *index) ...@@ -143,7 +143,7 @@ void tick_index(git_index *index)
times[0].tv_sec = ts; times[0].tv_sec = ts;
times[0].tv_usec = 0; times[0].tv_usec = 0;
times[1].tv_sec = ts + 1; times[1].tv_sec = ts + 5;
times[1].tv_usec = 0; times[1].tv_usec = 0;
cl_git_pass(p_utimes(git_index_path(index), times)); cl_git_pass(p_utimes(git_index_path(index), times));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment