mirror of
https://github.com/ollama/ollama.git
synced 2025-06-11 07:50:51 +02:00
fix(integration): move waitgroup Add(1) outside goroutine to avoid potential issue (#10070)
Signed-off-by: googs1025 <googs1025@gmail.com>
This commit is contained in:
parent
d98bfe7e70
commit
e7019c9455
@ -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) {
|
|||||||
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{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user