From f78b629f4029d790fa1dd7782dba25ee74251ab6 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Fri, 17 Jan 2025 01:05:26 +0100 Subject: [PATCH] cleanup after sync --- management/client/client_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/management/client/client_test.go b/management/client/client_test.go index 8bd8af8d2..2eb5fa8a2 100644 --- a/management/client/client_test.go +++ b/management/client/client_test.go @@ -256,10 +256,11 @@ func TestClient_Sync(t *testing.T) { t.Fatal(err) } - ch := make(chan *mgmtProto.SyncResponse, 1) + ch := make(chan *mgmtProto.SyncResponse, 5) + ctx, cancel := context.WithCancel(context.Background()) go func() { - err = client.Sync(context.Background(), info, func(msg *mgmtProto.SyncResponse) error { + err = client.Sync(ctx, info, func(msg *mgmtProto.SyncResponse) error { ch <- msg return nil }) @@ -289,6 +290,8 @@ func TestClient_Sync(t *testing.T) { case <-time.After(3 * time.Second): t.Error("timeout waiting for test to finish") } + + cancel() } func Test_SystemMetaDataFromClient(t *testing.T) {