Browse Source

clientv3/integration: ignore closing transport in TestKVPutStoppedServerAndClose

The grpc "transport is closing" error is rasied when the host is unreachable;
there's no good way to avoid it for a Put.

Fixes #5343
Anthony Romano 9 years ago
parent
commit
e4a2dcad9e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      clientv3/integration/kv_test.go

+ 3 - 1
clientv3/integration/kv_test.go

@@ -579,7 +579,9 @@ func TestKVPutStoppedServerAndClose(t *testing.T) {
 	clus.Members[0].Stop(t)
 	clus.Members[0].Stop(t)
 	// this Put fails and triggers an asynchronous connection retry
 	// this Put fails and triggers an asynchronous connection retry
 	_, err := clus.Client(0).Put(context.TODO(), "abc", "123")
 	_, err := clus.Client(0).Put(context.TODO(), "abc", "123")
-	if err == nil || !strings.Contains(err.Error(), "connection is closing") {
+	if err == nil ||
+		(!strings.Contains(err.Error(), "connection is closing") &&
+			!strings.Contains(err.Error(), "transport is closing")) {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
 	// cluster will terminate and close the client with the retry in-flight
 	// cluster will terminate and close the client with the retry in-flight