From e4b40acc7e5da5e7af20322a4055e1e1d3a7c6d5 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Wed, 5 Jul 2017 14:32:36 +0200 Subject: [PATCH] agent: remove unused code --- agent/consul/prepared_query_endpoint_test.go | 9 --------- agent/consul/txn_endpoint_test.go | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/agent/consul/prepared_query_endpoint_test.go b/agent/consul/prepared_query_endpoint_test.go index cf5346019b..16e332d6dd 100644 --- a/agent/consul/prepared_query_endpoint_test.go +++ b/agent/consul/prepared_query_endpoint_test.go @@ -2681,8 +2681,6 @@ func TestPreparedQuery_Wrapper(t *testing.T) { }) defer os.RemoveAll(dir1) defer s1.Shutdown() - codec1 := rpcClient(t, s1) - defer codec1.Close() dir2, s2 := testServerWithConfig(t, func(c *Config) { c.Datacenter = "dc2" @@ -2692,19 +2690,12 @@ func TestPreparedQuery_Wrapper(t *testing.T) { }) defer os.RemoveAll(dir2) defer s2.Shutdown() - codec2 := rpcClient(t, s2) - defer codec2.Close() testrpc.WaitForLeader(t, s1.RPC, "dc1") testrpc.WaitForLeader(t, s2.RPC, "dc2") // Try to WAN join. joinWAN(t, s2, s1) - retry.Run(t, func(r *retry.R) { - if got, want := len(s1.WANMembers()), 2; got != want { - r.Fatalf("got %d WAN members want %d", got, want) - } - }) // Try all the operations on a real server via the wrapper. wrapper := &queryServerWrapper{s1} diff --git a/agent/consul/txn_endpoint_test.go b/agent/consul/txn_endpoint_test.go index 5ac4ea513e..0a885446d5 100644 --- a/agent/consul/txn_endpoint_test.go +++ b/agent/consul/txn_endpoint_test.go @@ -162,8 +162,6 @@ func TestTxn_Apply_ACLDeny(t *testing.T) { }) defer os.RemoveAll(dir1) defer s1.Shutdown() - codec := rpcClient(t, s1) - defer codec.Close() testrpc.WaitForLeader(t, s1.RPC, "dc1") @@ -190,7 +188,7 @@ func TestTxn_Apply_ACLDeny(t *testing.T) { }, WriteRequest: structs.WriteRequest{Token: "root"}, } - if err := msgpackrpc.CallWithCodec(codec, "ACL.Apply", &arg, &id); err != nil { + if err := s1.RPC("ACL.Apply", &arg, &id); err != nil { t.Fatalf("err: %v", err) } } @@ -302,7 +300,7 @@ func TestTxn_Apply_ACLDeny(t *testing.T) { }, } var out structs.TxnResponse - if err := msgpackrpc.CallWithCodec(codec, "Txn.Apply", &arg, &out); err != nil { + if err := s1.RPC("Txn.Apply", &arg, &out); err != nil { t.Fatalf("err: %v", err) }