瀏覽代碼

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 年之前
父節點
當前提交
e4a2dcad9e
共有 1 個文件被更改,包括 3 次插入1 次删除
  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)
 	// this Put fails and triggers an asynchronous connection retry
 	_, 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)
 	}
 	// cluster will terminate and close the client with the retry in-flight