Skip to content

Commit

Permalink
Troubleshoot failing node versions tests: Adjust timeouts in devp2p t…
Browse files Browse the repository at this point in the history
…ests to avoid race conditions (#2895)

* Make timeout and wait longer

* Update comment

---------

Co-authored-by: Scotty <66335769+ScottyPoi@users.noreply.github.com>
Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 19, 2023
1 parent 966d7dd commit c1950ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/devp2p/src/dpt/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Server {
this._dpt = dpt
this._privateKey = privateKey

this._timeout = options.timeout ?? 2000 // 2 * 1000
this._timeout = options.timeout ?? 4000 // 4 * 1000
this._endpoint = options.endpoint ?? { address: '0.0.0.0', udpPort: null, tcpPort: null }
this._requests = new Map()
this._requestsCache = new LRU({ max: 1000, ttl: 1000, stale: false }) // 1 sec * 1000
Expand Down
2 changes: 1 addition & 1 deletion packages/devp2p/test/integration/dpt-simulator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('DPT simulator tests', () => {
await util.delay(400)
}

await util.delay(250)
await util.delay(500)

for (const dpt of dpts) {
assert.equal(dpt.getPeers().length, numDPTs, 'Peers should be distributed to all DPTs')
Expand Down

0 comments on commit c1950ac

Please sign in to comment.