Browse Source

Merge pull request #9787 from gyuho/fix

clientv3/integration: fix "TestMaintenanceSnapshotErrorInflight"
Gyuho Lee 7 years ago
parent
commit
e2a6489c1e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      clientv3/integration/maintenance_test.go

+ 3 - 2
clientv3/integration/maintenance_test.go

@@ -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 {
-		t.Errorf("expected %v, got %v", context.DeadlineExceeded, err)
+	if err != nil && !strings.Contains(err.Error(), context.DeadlineExceeded.Error()) {
+		t.Errorf("expected %v from gRPC, got %v", context.DeadlineExceeded, err)
 	}
 	}
 }
 }