From 0d5a889bff684fc7c670a4e03cebf3754242f271 Mon Sep 17 00:00:00 2001 From: Jake Taylor <jake@elixxir.io> Date: Tue, 31 Aug 2021 13:44:09 -0500 Subject: [PATCH] added some testing --- network/gateway/hostpool_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/network/gateway/hostpool_test.go b/network/gateway/hostpool_test.go index 15d1c4348..10e4683ea 100644 --- a/network/gateway/hostpool_test.go +++ b/network/gateway/hostpool_test.go @@ -316,6 +316,11 @@ func TestHostPool_ForceReplace(t *testing.T) { testStorage := storage.InitTestingSession(t) addGwChan := make(chan network.NodeGateway) + // Construct custom params + params := DefaultPoolParams() + params.PoolSize = uint32(len(testNdf.Gateways)) + + // Add a stale node newGateway := ndf.Gateway{ ID: id.NewIdFromUInt(27, id.Gateway, t).Bytes(), } @@ -326,10 +331,6 @@ func TestHostPool_ForceReplace(t *testing.T) { testNdf.Gateways = append(testNdf.Gateways, newGateway) testNdf.Nodes = append(testNdf.Nodes, newNode) - // Construct custom params - params := DefaultPoolParams() - params.PoolSize = uint32(len(testNdf.Gateways) - 1) // One of the nodes is set to stale - // Pull all gateways from ndf into host manager for _, gw := range testNdf.Gateways { @@ -356,9 +357,6 @@ func TestHostPool_ForceReplace(t *testing.T) { // Add all gateways to hostPool's map for i := uint32(0); i < params.PoolSize; i++ { gw := testNdf.Gateways[i] - if i == 0 { - continue - } gwId, err := id.Unmarshal(gw.ID) if err != nil { t.Fatalf("Failed to unmarshal ID in mock ndf: %v", err) -- GitLab