Remove redundant lines from coordinate test

This commit is contained in:
Kyle Havlovitz 2017-11-01 11:25:33 -07:00
parent 9909b661ac
commit 3542d7fcb6
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
3 changed files with 2 additions and 4 deletions

View File

@ -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
} }

View File

@ -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)

View File

@ -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"
) )