Test that we handle the case of a history row being old enough to purge before the
correcponding sync is finished. This can happen if the clock changes while we are syncing.
final String account = "a@example.com";
final String authority = "testprovider";
MockContentResolver mockResolver = new MockContentResolver();
SyncStorageEngine engine = SyncStorageEngine.newTestInstance(
new TestContext(mockResolver, getContext()));
long time0 = 1000;
long historyId = engine.insertStartSyncEvent(
account, authority, time0, Sync.History.SOURCE_LOCAL);
long time1 = time0 + SyncStorageEngine.MILLIS_IN_4WEEKS * 2;
engine.stopSyncEvent(historyId, time1 - time0, "yay", 0, 0);