Skip to content

Commit 204026c

Browse files
committed
test: fix TestLogGRPC ut failure
fix
1 parent e044d84 commit 204026c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/csi-common/server_test.go

Lines changed: 3 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,6 +32,8 @@ 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 * 2000)
3437
s.Start("tcp://127.0.0.1:0", nil, nil, nil, true)
3538
}
3639

0 commit comments

Comments
 (0)