@Test
public void testZooKeeperErrorDoesntLoseItemsReally() throws Exception {
final ZooKeeperClient mockClient = mock(ZooKeeperClient.class);
makeWriter(mockClient);
final String path = Paths.historyJobHostEventsTimestamp(JOB_ID, HOSTNAME, TIMESTAMP);
final KeeperException exc = new ConnectionLossException();
// make save operations fail
doThrow(exc).when(mockClient).createAndSetData(path, TASK_STATUS.toJsonBytes());
writer.saveHistoryItem(JOB_ID, TASK_STATUS, TIMESTAMP);
// wait up to 10s for it to fail twice -- and make sure I mocked it correctly.