From c1950acac1518ff15dc128d58253df4de81760b8 Mon Sep 17 00:00:00 2001 From: Scorbajio Date: Wed, 19 Jul 2023 12:41:08 -0700 Subject: [PATCH] Troubleshoot failing node versions tests: Adjust timeouts in devp2p tests 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> --- packages/devp2p/src/dpt/server.ts | 2 +- packages/devp2p/test/integration/dpt-simulator.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devp2p/src/dpt/server.ts b/packages/devp2p/src/dpt/server.ts index 4b68088c89..e3a444110d 100644 --- a/packages/devp2p/src/dpt/server.ts +++ b/packages/devp2p/src/dpt/server.ts @@ -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 diff --git a/packages/devp2p/test/integration/dpt-simulator.spec.ts b/packages/devp2p/test/integration/dpt-simulator.spec.ts index 32567af349..6ea25e5761 100644 --- a/packages/devp2p/test/integration/dpt-simulator.spec.ts +++ b/packages/devp2p/test/integration/dpt-simulator.spec.ts @@ -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')