Reduce go unittest time cost (#8555)

Signed-off-by: yhmo <yihua.mo@zilliz.com>
pull/8555/merge
groot 2021-09-26 12:42:14 +08:00 committed by GitHub
parent f4deb6d2d7
commit 6168c0b9c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -195,7 +195,7 @@ func TestPulsarClient_Consume1(t *testing.T) {
// launch produce
Produce(ctx, t, pc, topic, arr)
time.Sleep(1 * time.Second)
time.Sleep(100 * time.Millisecond)
// launch consume1
ctx1, cancel1 := context.WithTimeout(ctx, 2*time.Second)
@ -346,7 +346,7 @@ func TestPulsarClient_Consume2(t *testing.T) {
// launch produce
Produce(ctx, t, pc, topic, arr)
time.Sleep(1 * time.Second)
time.Sleep(100 * time.Millisecond)
// launch consume1
ctx1, cancel1 := context.WithTimeout(ctx, 2*time.Second)

View File

@ -120,7 +120,7 @@ func TestContextCancel(t *testing.T) {
}
go func() {
time.Sleep(1 * time.Second)
time.Sleep(100 * time.Millisecond)
cancel()
}()