|
@@ -5,6 +5,7 @@ import (
|
|
"fmt"
|
|
"fmt"
|
|
"net"
|
|
"net"
|
|
"os"
|
|
"os"
|
|
|
|
+ "sync"
|
|
"testing"
|
|
"testing"
|
|
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/google/uuid"
|
|
@@ -14,10 +15,12 @@ import (
|
|
)
|
|
)
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
func TestMain(m *testing.M) {
|
|
|
|
+ wg := &sync.WaitGroup{}
|
|
database.InitializeDatabase()
|
|
database.InitializeDatabase()
|
|
defer database.CloseDB()
|
|
defer database.CloseDB()
|
|
peerUpdate := make(chan *models.Node)
|
|
peerUpdate := make(chan *models.Node)
|
|
- go ManageZombies(context.Background(), peerUpdate)
|
|
|
|
|
|
+ wg.Add(1)
|
|
|
|
+ go ManageZombies(context.Background(), wg, peerUpdate)
|
|
go func() {
|
|
go func() {
|
|
for y := range peerUpdate {
|
|
for y := range peerUpdate {
|
|
fmt.Printf("Pointless %v\n", y)
|
|
fmt.Printf("Pointless %v\n", y)
|