Use distinct times for each TestRepository in acceptance tests

It is easy to create identical commits using e.g. PushOneCommit, which
uses a fixed commit message and tree contents by default. It uses
TestRepository's native commit timestamp ticking such that each new
commit gets a different commit timestamp, but this still causes
problems when multiple TestRepository instances are created in the
same process: each instance starts its clock at the same epoch.

The result is identical computed Change-Ids for completely unrelated
changes. Many tests (reasonably) assume that a Change-Id is unique
within the scope of that test, and this would violate that assumption
if we want to reuse a running server for multiple tests (and we do).

Work around this problem by giving each new TestRepository instance
(at least when created via GitUtil) its own 1-day window of
timestamps. There are some 8k 1-day windows until 2038 when JGit runs
out of 32-bit signed int timestamps, which should be enough for a
single test process. Likewise a 1-day window provides 86k ticks of the
clock before colliding with the next window, which should be enough
for a single test method.

Change-Id: Id86db8eb853d54bf2b88900274f595243e290fc4
2 files changed