From 3886129f525bc9a2908dcdcfe5176451f69e39e2 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 9 Mar 2016 13:57:36 -0800 Subject: [PATCH] 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. --- clientv3/integration/txn_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clientv3/integration/txn_test.go b/clientv3/integration/txn_test.go index 329f8419b..9655e621d 100644 --- a/clientv3/integration/txn_test.go +++ b/clientv3/integration/txn_test.go @@ -45,8 +45,9 @@ func TestTxnWriteFail(t *testing.T) { donec <- struct{}{} }() + dialTimeout := 5 * time.Second select { - case <-time.After(5 * time.Second): + case <-time.After(2*dialTimeout + time.Second): t.Fatalf("timed out waiting for txn to fail") case <-donec: // don't restart cluster until txn errors out