0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-06-06 12:39:17 +02:00

Fix the test

This commit is contained in:
Lunny Xiao 2024-04-08 21:46:00 +08:00
parent 7b860dda40
commit ba342cb58e
No known key found for this signature in database
GPG key ID: C3B7C91B632F738A

View file

@ -8,6 +8,7 @@ import (
"net/http"
"strconv"
"strings"
"sync"
"testing"
"code.gitea.io/gitea/models/db"
@ -263,8 +264,14 @@ func TestPackageMavenConcurrent(t *testing.T) {
t.Run("Concurrent Upload", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
var wg sync.WaitGroup
for i := 0; i < 10; i++ {
go putFile(t, fmt.Sprintf("/%s/%s.jar", packageVersion, strconv.Itoa(i)), "test", http.StatusCreated)
wg.Add(1)
go func() {
putFile(t, fmt.Sprintf("/%s/%s.jar", packageVersion, strconv.Itoa(i)), "test", http.StatusCreated)
wg.Done()
}()
}
wg.Wait()
})
}