Skip to content

Commit 109de2d

Browse files
committed
fix TestLogGRPC ut failure
fix TestLogGRPC ut failure
1 parent acc8924 commit 109de2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/csi-common/server_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package csicommon
1919
import (
2020
"sync"
2121
"testing"
22+
"time"
2223

2324
"github.com/stretchr/testify/assert"
2425
"google.golang.org/grpc"
@@ -31,7 +32,10 @@ func TestNewNonBlockingGRPCServer(t *testing.T) {
3132

3233
func TestStart(t *testing.T) {
3334
s := NewNonBlockingGRPCServer()
35+
// sleep a while to avoid race condition in unit test
36+
time.Sleep(time.Millisecond * 500)
3437
s.Start("tcp://127.0.0.1:0", nil, nil, nil, true)
38+
time.Sleep(time.Millisecond * 500)
3539
}
3640

3741
func TestServe(t *testing.T) {

0 commit comments

Comments
 (0)