Commit 116358e
authored
test(sim): use directPeers for backup eth provider sim test (ChainSafe#8917)
## Description
Fix flaky `backupEthProvider.test.ts` sim test by configuring
`directPeers` on node-2 and node-3 to maintain stable peer connections.
### Problem
The backup eth provider sim test fails intermittently with
`connectedPeerCount` assertion failures — nodes 2 and 3 show
`connections=1` when `expectedConnections=2`. Peer connections degrade
over time without a mechanism to maintain them.
CI failure:
https://github.com/ChainSafe/lodestar/actions/runs/22065271031
### Solution
Apply the same `directPeers` approach used in ChainSafe#8912 for other sim tests:
1. Start node-1 first and cache its multiaddr
2. Create node-2 with `directPeers=[node1]` for persistent mesh
connectivity
3. Create node-3 with `directPeers=[node1, node2]` for full mesh
4. GossipSub's heartbeat automatically reconnects direct peers (~700ms)
### Changes
- Sequential node startup instead of simultaneous (node-1 → node-2 →
node-3)
- Added `directPeers` to `clientOptions` for node-2 and node-3
- Imported `connectNewNode` for individual node connection after startup
🤖 Generated with AI assistance (Claude)
Co-authored-by: lodekeeper <lodekeeper@users.noreply.github.com>1 parent d0ec492 commit 116358e
1 file changed
+23
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
56 | 69 | | |
57 | 70 | | |
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
61 | 74 | | |
62 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
63 | 79 | | |
64 | 80 | | |
65 | 81 | | |
66 | 82 | | |
67 | 83 | | |
68 | | - | |
| 84 | + | |
| 85 | + | |
69 | 86 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 87 | + | |
| 88 | + | |
73 | 89 | | |
74 | 90 | | |
75 | 91 | | |
| |||
0 commit comments