mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-09 15:48:08 -05:00
test: fix few e2e flaky tests (#7762)
**Motivation** Make our tests more stable on CI. **Description** Fix following flaky tests - `packages/beacon-node/test/e2e/network/reqresp.test.ts` - [AxiosError: Request failed with status code 429](https://github.com/ChainSafe/lodestar/actions/runs/14731164867/job/41349996153?pr=7762#step:6:10755) Partially Closes #6358 **Steps to test or reproduce** - Run all tests on CI
This commit is contained in:
@@ -52,14 +52,19 @@ function assertCorrectPreset(localPreset: BeaconPreset, remotePreset: BeaconPres
|
||||
}
|
||||
|
||||
async function downloadRemoteConfig(preset: "mainnet" | "minimal", commit: string): Promise<BeaconPreset> {
|
||||
const downloadedParams = await Promise.all(
|
||||
Object.values(ForkName).map((forkName) =>
|
||||
axios({
|
||||
url: `https://raw.githubusercontent.com/ethereum/consensus-specs/${commit}/presets/${preset}/${forkName}.yaml`,
|
||||
timeout: 30 * 1000,
|
||||
}).then((response) => loadConfigYaml(response.data))
|
||||
)
|
||||
);
|
||||
const downloadedParams: Record<string, unknown>[] = [];
|
||||
|
||||
for (const forkName of Object.values(ForkName)) {
|
||||
const response = await axios({
|
||||
url: `https://raw.githubusercontent.com/ethereum/consensus-specs/${commit}/presets/${preset}/${forkName}.yaml`,
|
||||
timeout: 30 * 1000,
|
||||
});
|
||||
downloadedParams.push(loadConfigYaml(response.data));
|
||||
|
||||
// We get error `Request failed with status code 429`
|
||||
// which is `Too Many Request` so we added a bit delay between each request
|
||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||
}
|
||||
|
||||
// Merge all the fetched yamls for the different forks
|
||||
const beaconPresetRaw: Record<string, unknown> = Object.assign(
|
||||
|
||||
Reference in New Issue
Block a user