Skip to content

Commit 3de3774

Browse files
authored
fix(infra): retry GitHub registry fetches in warp IDs test (#8278)
1 parent 43255a9 commit 3de3774

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

typescript/infra/test/warpIds.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from 'chai';
22

33
import { DEFAULT_GITHUB_REGISTRY } from '@hyperlane-xyz/registry';
44
import { getRegistry } from '@hyperlane-xyz/registry/fs';
5-
import { rootLogger } from '@hyperlane-xyz/utils';
5+
import { retryAsync, rootLogger } from '@hyperlane-xyz/utils';
66

77
import { WarpRouteIds } from '../config/environments/mainnet3/warp/warpIds.js';
88

@@ -16,9 +16,15 @@ describe('Warp IDs', function () {
1616
logger: rootLogger,
1717
});
1818
for (const warpId of Object.values(WarpRouteIds)) {
19-
// That's a long sentence!
19+
// Retry to handle transient network failures (e.g. socket closed)
20+
// when fetching from GitHub registry in CI
21+
const route = await retryAsync(
22+
() => registry.getWarpRoute(warpId),
23+
3,
24+
500,
25+
);
2026
expect(
21-
await registry.getWarpRoute(warpId),
27+
route,
2228
`Warp ID ${warpId} not in registry, the .registryrc or your local registry may be out of date`,
2329
).to.not.be.null.and.not.be.undefined;
2430
}

0 commit comments

Comments
 (0)