From 0431587765e9b3563e8e6bb033b32ad8b7411fc9 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 16 Mar 2022 22:14:01 +0100 Subject: [PATCH] test_providers: add optional delay during bootstrap Signed-off-by: Csaba Kiraly --- tests/dht/test_providers.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/dht/test_providers.nim b/tests/dht/test_providers.nim index 748930a..0897971 100644 --- a/tests/dht/test_providers.nim +++ b/tests/dht/test_providers.nim @@ -29,15 +29,19 @@ import proc bootstrapNodes( nodecount: int, bootnodes: seq[SignedPeerRecord], - rng = keys.newRng() + rng = keys.newRng(), + delay: int = 0 ) : Future[seq[(discv5_protocol.Protocol, keys.PrivateKey)]] {.async.} = + debug "---- STARTING BOOSTRAPS ---" for i in 0.. 0: + await sleepAsync(chronos.milliseconds(delay)) + #await allFutures(result.mapIt(it.bootstrap())) # this waits for bootstrap based on bootENode, which includes bonding with all its ping pongs