Browse Source

Remove redundant lines from coordinate test

pull/3622/head
Kyle Havlovitz 7 years ago
parent
commit
021b2849c5
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
  1. 1
      agent/coordinate_endpoint.go
  2. 2
      agent/coordinate_endpoint_test.go
  3. 3
      api/coordinate_test.go

1
agent/coordinate_endpoint.go

@ -105,7 +105,6 @@ func (s *HTTPServer) CoordinateNode(resp http.ResponseWriter, req *http.Request)
var out structs.IndexedCoordinates var out structs.IndexedCoordinates
defer setMeta(resp, &out.QueryMeta) defer setMeta(resp, &out.QueryMeta)
if err := s.agent.RPC("Coordinate.Node", &args, &out); err != nil { if err := s.agent.RPC("Coordinate.Node", &args, &out); err != nil {
sort.Sort(&sorter{out.Coordinates})
return nil, err return nil, err
} }

2
agent/coordinate_endpoint_test.go

@ -194,7 +194,7 @@ func TestCoordinate_Node(t *testing.T) {
} }
time.Sleep(300 * time.Millisecond) time.Sleep(300 * time.Millisecond)
// Query back and check the nodes are present and sorted correctly. // Query back and check the nodes are present.
req, _ = http.NewRequest("GET", "/v1/coordinate/node/foo?dc=dc1", nil) req, _ = http.NewRequest("GET", "/v1/coordinate/node/foo?dc=dc1", nil)
resp = httptest.NewRecorder() resp = httptest.NewRecorder()
obj, err = a.srv.CoordinateNode(resp, req) obj, err = a.srv.CoordinateNode(resp, req)

3
api/coordinate_test.go

@ -1,9 +1,8 @@
package api package api
import ( import (
"testing"
"strings" "strings"
"testing"
"github.com/hashicorp/consul/testutil/retry" "github.com/hashicorp/consul/testutil/retry"
) )

Loading…
Cancel
Save