Update garray_z_unit_string_test.go

This commit is contained in:
jroam
2019-07-08 17:53:57 +08:00
parent 46721d7552
commit ed6796dde0

View File

@ -647,8 +647,8 @@ func TestStringArray_RLockFunc(t *testing.T) {
ch1 := make(chan int64, 3)
//go1
go a1.RLockFunc(func(n1 []string) { //读锁
time.Sleep(2 * time.Second) //暂停1秒
n1[2] = "g"
time.Sleep(2 * time.Second) //暂停2秒
ch1 <- gconv.Int64(time.Now().UnixNano() / 1000 / 1000)
})
@ -665,7 +665,7 @@ func TestStringArray_RLockFunc(t *testing.T) {
<-ch1 //等待go1完成
// 防止ci抖动,以豪秒为单位
gtest.AssertLT(t2-t1, 20)
gtest.AssertLT(t2-t1, 20) //go1加的读锁所go2读的时候并没有阻塞。
gtest.Assert(a1.Contains("g"), true)
})
}