From 5214c9feb9d3bd3b7d575a01e0ba82fffb9a6119 Mon Sep 17 00:00:00 2001
From: Jake Taylor <jake@elixxir.io>
Date: Thu, 8 Apr 2021 14:39:09 -0500
Subject: [PATCH] FIX TESTS

---
 network/gateway/hostPool.go      | 13 +++----------
 network/gateway/hostpool_test.go |  2 +-
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/network/gateway/hostPool.go b/network/gateway/hostPool.go
index ba6cd338a..71ae48456 100644
--- a/network/gateway/hostPool.go
+++ b/network/gateway/hostPool.go
@@ -91,21 +91,14 @@ func newHostPool(poolParams PoolParams, rng io.Reader, ndf *ndf.NetworkDefinitio
 		addGatewayChan: addGateway,
 	}
 
-	// Propagate the NDF and return
+	// Propagate the NDF
 	err := result.updateConns()
 	if err != nil {
 		return nil, err
 	}
 
-	// Build the initial HostPool
-	err = result.pruneHostPool()
-	if err != nil {
-		return nil, err
-	}
-
-	// Convert the NDF into an empty map object in order to allow updateConns
-	result.ndfMap, err = convertNdfToMap(nil)
-	return result, err
+	// Build the initial HostPool and return
+	return result, result.pruneHostPool()
 }
 
 // UpdateNdf Mutates internal ndf to the given ndf
diff --git a/network/gateway/hostpool_test.go b/network/gateway/hostpool_test.go
index a1feb5a37..4fd01a3f4 100644
--- a/network/gateway/hostpool_test.go
+++ b/network/gateway/hostpool_test.go
@@ -115,7 +115,7 @@ func TestHostPool_ManageHostPool(t *testing.T) {
 
 	testPool.UpdateNdf(newNdf)
 
-	time.Sleep(2 * time.Second)
+	time.Sleep(testPool.poolParams.PruneInterval + 1*time.Second)
 
 	// Check that old gateways are not in pool
 	for _, ndfGw := range testNdf.Gateways {
-- 
GitLab