(test)
| 16 | // retrying with a backoff is a good strategy: |
| 17 | module.exports = { |
| 18 | async delay(test) { |
| 19 | const retries = test.currentRetry(); |
| 20 | if (retries === 0) return; // no retry on the first failure. |
| 21 | // see: https://cloud.google.com/storage/docs/exponential-backoff: |
| 22 | const ms = Math.pow(2, retries) * 1000 + Math.random() * 2000; |
| 23 | return new Promise(done => { |
| 24 | console.info(`retrying "${test.title}" in ${ms}ms`); |
| 25 | setTimeout(done, ms); |
| 26 | }); |
| 27 | }, |
| 28 | }; |
no outgoing calls
no test coverage detected