1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05: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()
})
}