Unverified Commit e7019c94 authored by CYJiang's avatar CYJiang Committed by GitHub
Browse files

fix(integration): move waitgroup Add(1) outside goroutine to avoid potential issue (#10070)


Signed-off-by: default avatargoogs1025 <googs1025@gmail.com>
parent d98bfe7e
...@@ -52,8 +52,8 @@ func TestMaxQueue(t *testing.T) { ...@@ -52,8 +52,8 @@ func TestMaxQueue(t *testing.T) {
embedCtx := ctx embedCtx := ctx
var genwg sync.WaitGroup var genwg sync.WaitGroup
genwg.Add(1)
go func() { go func() {
genwg.Add(1)
defer genwg.Done() defer genwg.Done()
slog.Info("Starting generate request") slog.Info("Starting generate request")
DoGenerate(ctx, t, client, req, resp, 45*time.Second, 5*time.Second) DoGenerate(ctx, t, client, req, resp, 45*time.Second, 5*time.Second)
...@@ -71,8 +71,8 @@ func TestMaxQueue(t *testing.T) { ...@@ -71,8 +71,8 @@ func TestMaxQueue(t *testing.T) {
counterMu := sync.Mutex{} counterMu := sync.Mutex{}
var embedwg sync.WaitGroup var embedwg sync.WaitGroup
for i := 0; i < threadCount; i++ { for i := 0; i < threadCount; i++ {
embedwg.Add(1)
go func(i int) { go func(i int) {
embedwg.Add(1)
defer embedwg.Done() defer embedwg.Done()
slog.Info("embed started", "id", i) slog.Info("embed started", "id", i)
embedReq := api.EmbeddingRequest{ embedReq := api.EmbeddingRequest{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment