mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix vid_map_test
tests
This commit is contained in:
parent
58c02d6429
commit
994a2dec78
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -112,18 +113,23 @@ func TestLookupFileId(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//lock: concurrent test
|
//lock: concurrent test
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
for i := 0; i < 20; i++ {
|
||||||
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
for i := 0; i < 100; i++ {
|
defer wg.Done()
|
||||||
mc.addLocation(uint32(i), Location{})
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
for i := 0; i < 10; i++ {
|
|
||||||
for i := 0; i < 100; i++ {
|
for i := 0; i < 100; i++ {
|
||||||
for i := 0; i < 20; i++ {
|
for i := 0; i < 20; i++ {
|
||||||
_, _ = mc.GetLocations(uint32(i))
|
_, _ = mc.GetLocations(uint32(i))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for i := 0; i < 100; i++ {
|
||||||
|
mc.addLocation(uint32(i), Location{})
|
||||||
|
}
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkLocationIndex(b *testing.B) {
|
func BenchmarkLocationIndex(b *testing.B) {
|
||||||
|
|
Loading…
Reference in a new issue