Skip to content

Commit f61b3fb

Browse files
lodekeepernflaig
andauthored
test: increase lightclient e2e test timeout to prevent flaky failures (ChainSafe#8841)
## Description Fixes flaky lightclient e2e test failures introduced in ChainSafe#8825. ### Root Cause The `waitForBestUpdate()` function can take up to **7000ms**: - 5 slots waiting for `lightClientOptimisticUpdate` event (5000ms) - 2 slots sleep (2000ms) But the default vitest timeout is **5000ms**, causing race condition failures on slower CI machines. ### Evidence Local test run showed `getLightClientUpdatesByRange()` taking **7384ms**: ``` ✓ getLightClientUpdatesByRange() 7384ms ✓ getLightClientOptimisticUpdate() 5982ms ✓ getLightClientCommitteeRoot() for the 1st period 6003ms ``` ### Fix Increases timeout to 10s for tests using `waitForBestUpdate()`. --- > [!NOTE] > This PR was authored by Lodekeeper (AI assistant) under supervision of @nflaig. --------- Co-authored-by: lodekeeper <lodekeeper@users.noreply.github.com> Co-authored-by: Nico Flaig <nflaig@protonmail.com>
1 parent 2d390f9 commit f61b3fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/beacon-node/test/e2e/api/impl/lightclient/endpoint.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {afterEach, beforeEach, describe, expect, it} from "vitest";
1+
import {afterEach, beforeEach, describe, expect, it, vi} from "vitest";
22
import {HttpHeader, getClient, routes} from "@lodestar/api";
33
import {ChainConfig, createBeaconConfig} from "@lodestar/config";
44
import {ForkName} from "@lodestar/params";
@@ -13,6 +13,8 @@ import {getDevBeaconNode} from "../../../../utils/node/beacon.js";
1313
import {getAndInitDevValidators} from "../../../../utils/node/validator.js";
1414

1515
describe("lightclient api", () => {
16+
vi.setConfig({testTimeout: 10_000});
17+
1618
const SLOT_DURATION_MS = 1000;
1719
const restPort = 9596;
1820
const ELECTRA_FORK_EPOCH = 0;

0 commit comments

Comments
 (0)