From 25d20af3a4b4a5e8d3e3191f30fddc8568b754c1 Mon Sep 17 00:00:00 2001 From: Fabio Barone Date: Fri, 20 Jul 2018 09:51:56 -0500 Subject: [PATCH] swarm: enforce waitkademlia for snapshot tests --- swarm/network/stream/snapshot_retrieval_test.go | 12 ++++-------- swarm/network/stream/snapshot_sync_test.go | 13 +++++-------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/swarm/network/stream/snapshot_retrieval_test.go b/swarm/network/stream/snapshot_retrieval_test.go index c95c0f773a..2f023ed08c 100644 --- a/swarm/network/stream/snapshot_retrieval_test.go +++ b/swarm/network/stream/snapshot_retrieval_test.go @@ -199,10 +199,8 @@ func runFileRetrievalTest(nodeCount int) error { if err != nil { return err } - if *waitKademlia { - if _, err := sim.WaitTillHealthy(ctx, 2); err != nil { - return err - } + if _, err := sim.WaitTillHealthy(ctx, 2); err != nil { + return err } // File retrieval check is repeated until all uploaded files are retrieved from all nodes @@ -354,10 +352,8 @@ func runRetrievalTest(chunkCount int, nodeCount int) error { if err != nil { return err } - if *waitKademlia { - if _, err := sim.WaitTillHealthy(ctx, 2); err != nil { - return err - } + if _, err := sim.WaitTillHealthy(ctx, 2); err != nil { + return err } // File retrieval check is repeated until all uploaded files are retrieved from all nodes diff --git a/swarm/network/stream/snapshot_sync_test.go b/swarm/network/stream/snapshot_sync_test.go index c9aacee02c..10d3d62f01 100644 --- a/swarm/network/stream/snapshot_sync_test.go +++ b/swarm/network/stream/snapshot_sync_test.go @@ -200,10 +200,9 @@ func testSyncing(t *testing.T, chunkCount int, nodeCount int) { } conf.hashes = append(conf.hashes, hashes...) mapKeysToNodes(conf) - if *waitKademlia { - if _, err := sim.WaitTillHealthy(ctx, 2); err != nil { - return err - } + + if _, err := sim.WaitTillHealthy(ctx, 2); err != nil { + return err } // File retrieval check is repeated until all uploaded files are retrieved from all nodes @@ -408,10 +407,8 @@ func runSyncTest(chunkCount int, nodeCount int) error { conf.hashes = append(conf.hashes, hashes...) mapKeysToNodes(conf) - if *waitKademlia { - if _, err := sim.WaitTillHealthy(ctx, 2); err != nil { - return err - } + if _, err := sim.WaitTillHealthy(ctx, 2); err != nil { + return err } var gDir string