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:
Nazar Hussain
2025-05-07 14:20:08 +02:00
committed by GitHub
parent 0f6a8b1a77
commit 0eb947d0d0
8 changed files with 90 additions and 36 deletions

View File

@@ -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(