From e7019c94554e6d93bf216cb484c8c1c69df98fcb Mon Sep 17 00:00:00 2001 From: CYJiang <86391540+googs1025@users.noreply.github.com> Date: Wed, 9 Apr 2025 06:17:40 +0800 Subject: [PATCH] fix(integration): move waitgroup Add(1) outside goroutine to avoid potential issue (#10070) Signed-off-by: googs1025 --- integration/max_queue_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration/max_queue_test.go b/integration/max_queue_test.go index c316aa62b..502795311 100644 --- a/integration/max_queue_test.go +++ b/integration/max_queue_test.go @@ -52,8 +52,8 @@ func TestMaxQueue(t *testing.T) { embedCtx := ctx var genwg sync.WaitGroup + genwg.Add(1) go func() { - genwg.Add(1) defer genwg.Done() slog.Info("Starting generate request") DoGenerate(ctx, t, client, req, resp, 45*time.Second, 5*time.Second) @@ -71,8 +71,8 @@ func TestMaxQueue(t *testing.T) { counterMu := sync.Mutex{} var embedwg sync.WaitGroup for i := 0; i < threadCount; i++ { + embedwg.Add(1) go func(i int) { - embedwg.Add(1) defer embedwg.Done() slog.Info("embed started", "id", i) embedReq := api.EmbeddingRequest{