From a86a5d6cacfcf3bc0e182d1e727dfd687bc80f7f Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 10 May 2023 00:45:50 +0200 Subject: [PATCH] warn and skip test nodes on busy ports TODO: We might want to still generate the right amount Signed-off-by: Csaba Kiraly --- tests/dht/test_providers.nim | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/dht/test_providers.nim b/tests/dht/test_providers.nim index fecb9b9..cdbb74d 100644 --- a/tests/dht/test_providers.nim +++ b/tests/dht/test_providers.nim @@ -33,12 +33,16 @@ proc bootstrapNodes( debug "---- STARTING BOOSTRAPS ---" for i in 0.. 0: - await sleepAsync(chronos.milliseconds(delay)) + try: + let privKey = PrivateKey.example(rng) + let node = initDiscoveryNode(rng, privKey, localAddress(20302 + i), bootnodes) + await node.start() + result.add((node, privKey)) + if delay > 0: + await sleepAsync(chronos.milliseconds(delay)) + except TransportOsError as e: + echo "skipping node ",i ,":", e.msg + #await allFutures(result.mapIt(it.bootstrap())) # this waits for bootstrap based on bootENode, which includes bonding with all its ping pongs