diff --git a/command/agent/alloc_endpoint_test.go b/command/agent/alloc_endpoint_test.go index 10b6f249a50..62892da7eec 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 stats 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 } diff --git a/command/agent/stats_endpoint_test.go b/command/agent/stats_endpoint_test.go index 6cc1f178ec6..2720b1a0cad 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 } })