mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
[tests] Add retrying for GitHub actions connection error (#5533)
Follow-up to https://github.com/vercel/vercel/pull/5526 this also adds retrying for fetch connection issues in GitHub Actions to prevent false test failures. x-ref: https://github.com/vercel/vercel/runs/1518604380
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
const fetch = require('node-fetch');
|
||||
const retryBailByDefault = require('./retry-bail-by-default.js');
|
||||
|
||||
async function fetchRetry (...args) {
|
||||
async function fetchRetry(...args) {
|
||||
return await retryBailByDefault(
|
||||
async (canRetry) => {
|
||||
async canRetry => {
|
||||
try {
|
||||
return await fetch(...args);
|
||||
} catch (error) {
|
||||
@@ -14,6 +14,8 @@ async function fetchRetry (...args) {
|
||||
// request to https://api-gru1.vercel.com/v3/now/deployments/dpl_FBWWhpQomjgwjJLu396snLrGZYCm failed, reason:
|
||||
// connect ETIMEDOUT 18.228.143.224:443
|
||||
throw canRetry(error);
|
||||
} else if (error.code === 'ECONNRESET') {
|
||||
throw canRetry(error);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user