From c7dded0c4b017384a849bb98e1fbca1676a10d56 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Thu, 31 Mar 2022 14:24:24 +0000 Subject: [PATCH] Apply Eclesio's fix suggestions --- tests/utils/gossamer_utils.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/utils/gossamer_utils.go b/tests/utils/gossamer_utils.go index df74841441e..35ef8d1f8cf 100644 --- a/tests/utils/gossamer_utils.go +++ b/tests/utils/gossamer_utils.go @@ -320,6 +320,7 @@ func InitializeAndStartNodes(t *testing.T, num int, genesis, config string) ( for i := 0; i < num; i++ { go func(i int) { + defer wg.Done() name := strconv.Itoa(i) if i < len(KeyList) { name = KeyList[i] @@ -337,7 +338,6 @@ func InitializeAndStartNodes(t *testing.T, num int, genesis, config string) ( nodesMutex.Lock() nodes = append(nodes, node) nodesMutex.Unlock() - wg.Done() }(i) } @@ -361,6 +361,7 @@ func InitializeAndStartNodesWebsocket(t *testing.T, num int, genesis, config str for i := 0; i < num; i++ { go func(i int) { + defer wg.Done() name := strconv.Itoa(i) if i < len(KeyList) { name = KeyList[i] @@ -378,8 +379,6 @@ func InitializeAndStartNodesWebsocket(t *testing.T, num int, genesis, config str nodesMutex.Lock() nodes = append(nodes, node) nodesMutex.Unlock() - - wg.Done() }(i) }