From 6b192593a1e0f7f65e68fb1707aa5921122d584e Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Wed, 30 May 2018 14:40:09 -0500 Subject: [PATCH 1/2] Fix failing test TestHTTP_AllocAllGC --- command/agent/alloc_endpoint_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/command/agent/alloc_endpoint_test.go b/command/agent/alloc_endpoint_test.go index 10b6f249a..059c0eb30 100644 --- a/command/agent/alloc_endpoint_test.go +++ b/command/agent/alloc_endpoint_test.go @@ -697,7 +697,7 @@ func TestHTTP_AllocAllGC(t *testing.T) { s.server = srv } - // no client, server resp + // client GC from server, should not error { c := s.client s.client = nil @@ -717,10 +717,7 @@ func TestHTTP_AllocAllGC(t *testing.T) { respW := httptest.NewRecorder() _, err = s.Server.ClientGCRequest(respW, req) - require.NotNil(err) - - // The dev agent uses in-mem RPC so just assert the no route error - require.Contains(err.Error(), structs.ErrNoNodeConn.Error()) + require.Nil(err) s.client = c } From 51a5b592c580029a83eebb9f8e81c02dc4e535de Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Wed, 30 May 2018 14:45:10 -0500 Subject: [PATCH 2/2] Fix failing test TestClientStatusRequest --- command/agent/alloc_endpoint_test.go | 2 +- command/agent/stats_endpoint_test.go | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/command/agent/alloc_endpoint_test.go b/command/agent/alloc_endpoint_test.go index 059c0eb30..62892da7e 100644 --- a/command/agent/alloc_endpoint_test.go +++ b/command/agent/alloc_endpoint_test.go @@ -697,7 +697,7 @@ func TestHTTP_AllocAllGC(t *testing.T) { s.server = srv } - // client GC from server, should not error + // client stats from server, should not error { c := s.client s.client = nil diff --git a/command/agent/stats_endpoint_test.go b/command/agent/stats_endpoint_test.go index 6cc1f178e..2720b1a0c 100644 --- a/command/agent/stats_endpoint_test.go +++ b/command/agent/stats_endpoint_test.go @@ -34,7 +34,7 @@ func TestClientStatsRequest(t *testing.T) { } } - // Local node, server resp + // client stats from server, should not error { srv := s.server s.server = nil @@ -70,11 +70,7 @@ func TestClientStatsRequest(t *testing.T) { respW := httptest.NewRecorder() _, err = s.Server.ClientStatsRequest(respW, req) - require.NotNil(err) - - // The dev agent uses in-mem RPC so just assert the no route error - require.Contains(err.Error(), structs.ErrNoNodeConn.Error()) - + require.Nil(err) s.client = c } })