function eventually(testFunction) {
  return async () => {
    let delayMs = 2000;
    for (let i = 0; i < 2; ++i) {
      try {
        return await testFunction();
      } catch (e) {
        await new Promise(resolve => setTimeout(resolve, delayMs));
        delayMs *= 2;
      }
    }
    return await testFunction();
  };
}
For eventually consistent APIs, retry the test after a few seconds, up to 3 times.
@param {function} testFunction the test function to retry.
@returns {function}