Merge pull request #9787 from gyuho/fix

clientv3/integration: fix "TestMaintenanceSnapshotErrorInflight"
release-3.4
Gyuho Lee 2018-05-29 13:33:22 -07:00 committed by GitHub
commit e2a6489c1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -21,6 +21,7 @@ import (
"io" "io"
"io/ioutil" "io/ioutil"
"path/filepath" "path/filepath"
"strings"
"testing" "testing"
"time" "time"
@ -188,7 +189,7 @@ func TestMaintenanceSnapshotErrorInflight(t *testing.T) {
// 300ms left and expect timeout while snapshot reading is in progress // 300ms left and expect timeout while snapshot reading is in progress
time.Sleep(700 * time.Millisecond) time.Sleep(700 * time.Millisecond)
_, err = io.Copy(ioutil.Discard, rc2) _, err = io.Copy(ioutil.Discard, rc2)
if err != nil && err != context.DeadlineExceeded { if err != nil && !strings.Contains(err.Error(), context.DeadlineExceeded.Error()) {
t.Errorf("expected %v, got %v", context.DeadlineExceeded, err) t.Errorf("expected %v from gRPC, got %v", context.DeadlineExceeded, err)
} }
} }