1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

fix: fix TestConcurrentMap_Delete test failed

This commit is contained in:
dudaodong
2023-07-25 10:21:11 +08:00
parent 0456b65cc7
commit a0431d9435

View File

@@ -42,13 +42,18 @@ func TestConcurrentMap_GetOrSet(t *testing.T) {
cm := NewConcurrentMap[string, int](100)
var wg sync.WaitGroup
wg.Add(5)
for i := 0; i < 5; i++ {
go func(n int) {
val, ok := cm.GetOrSet(fmt.Sprintf("%d", n), n)
assert.Equal(n, val)
assert.Equal(false, ok)
wg.Done()
}(i)
}
wg.Wait()
for j := 0; j < 5; j++ {
go func(n int) {