From c1f241119f3750ff3457da97fe0d4039c8ffebc7 Mon Sep 17 00:00:00 2001 From: Fabio Barone Date: Mon, 17 Dec 2018 19:58:42 -0500 Subject: [PATCH] swarm: swap tests simplification --- swarm/swap_test.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/swarm/swap_test.go b/swarm/swap_test.go index b2f7497a24..36d0c3b727 100644 --- a/swarm/swap_test.go +++ b/swarm/swap_test.go @@ -136,12 +136,9 @@ func TestSwapNetworkSymmetricFileUpload(t *testing.T) { // File retrieval check is repeated until all uploaded files are retrieved from all nodes // or until the timeout is reached. - for { - //we use a special retrieve function for swap which is optimized for parallel requests - //but does not leave many cascaded requests floating around - if retrieveForSwap(sim, files) == 0 { - break - } + //we use a special retrieve function for swap which is optimized for parallel requests + //but does not leave many cascaded requests floating around + for retrieveForSwap(sim, files) != 0 { } //iterate all nodes @@ -312,12 +309,9 @@ func TestSwapNetworkAsymmetricFileUpload(t *testing.T) { // File retrieval check is repeated until all uploaded files are retrieved from all nodes // or until the timeout is reached. - for { - //we use a special retrieve function for swap which is optimized for parallel requests - //but does not leave many cascaded requests floating around - if retrieveForSwap(sim, files) == 0 { - break - } + //we use a special retrieve function for swap which is optimized for parallel requests + //but does not leave many cascaded requests floating around + for retrieveForSwap(sim, files) != 0 { } for _, node := range sim.NodeIDs() {