Skip to content

Commit

Permalink
fix TestLogGRPC ut failure
Browse files Browse the repository at this point in the history
fix TestLogGRPC ut failure
  • Loading branch information
umagnus committed Aug 11, 2022
1 parent acc8924 commit 109de2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/csi-common/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package csicommon
import (
"sync"
"testing"
"time"

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

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

func TestServe(t *testing.T) {
Expand Down

0 comments on commit 109de2d

Please sign in to comment.