浏览代码

clientv3/integration: fix TestTxnWriteFail

It might take client request more than dialtimeout to fail when
we kill the connection when the client is sending request.
Xiang Li 10 年之前
父节点
当前提交
3886129f52
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      clientv3/integration/txn_test.go

+ 2 - 1
clientv3/integration/txn_test.go

@@ -45,8 +45,9 @@ func TestTxnWriteFail(t *testing.T) {
 		donec <- struct{}{}
 		donec <- struct{}{}
 	}()
 	}()
 
 
+	dialTimeout := 5 * time.Second
 	select {
 	select {
-	case <-time.After(5 * time.Second):
+	case <-time.After(2*dialTimeout + time.Second):
 		t.Fatalf("timed out waiting for txn to fail")
 		t.Fatalf("timed out waiting for txn to fail")
 	case <-donec:
 	case <-donec:
 		// don't restart cluster until txn errors out
 		// don't restart cluster until txn errors out