Merge pull request #1861 from hashicorp/b-flaky-test
Widens coordinate update sleeps in unit tests.
This commit is contained in:
commit
2c61c1d333
|
@ -271,7 +271,7 @@ func TestCatalogNodes_DistanceSort(t *testing.T) {
|
||||||
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
time.Sleep(200 * time.Millisecond)
|
time.Sleep(300 * time.Millisecond)
|
||||||
|
|
||||||
// Query again and now foo should have moved to the front of the line.
|
// Query again and now foo should have moved to the front of the line.
|
||||||
req, err = http.NewRequest("GET", "/v1/catalog/nodes?dc=dc1&near=foo", nil)
|
req, err = http.NewRequest("GET", "/v1/catalog/nodes?dc=dc1&near=foo", nil)
|
||||||
|
@ -482,7 +482,7 @@ func TestCatalogServiceNodes_DistanceSort(t *testing.T) {
|
||||||
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
time.Sleep(200 * time.Millisecond)
|
time.Sleep(300 * time.Millisecond)
|
||||||
|
|
||||||
// Query again and now foo should have moved to the front of the line.
|
// Query again and now foo should have moved to the front of the line.
|
||||||
req, err = http.NewRequest("GET", "/v1/catalog/service/api?tag=a&near=foo", nil)
|
req, err = http.NewRequest("GET", "/v1/catalog/service/api?tag=a&near=foo", nil)
|
||||||
|
|
|
@ -99,7 +99,7 @@ func TestCoordinate_Nodes(t *testing.T) {
|
||||||
if err := srv.agent.RPC("Coordinate.Update", &arg2, &out); err != nil {
|
if err := srv.agent.RPC("Coordinate.Update", &arg2, &out); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
time.Sleep(200 * 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 and sorted correctly.
|
||||||
req, err = http.NewRequest("GET", "/v1/coordinate/nodes?dc=dc1", nil)
|
req, err = http.NewRequest("GET", "/v1/coordinate/nodes?dc=dc1", nil)
|
||||||
|
|
|
@ -126,7 +126,7 @@ func TestHealthChecksInState_DistanceSort(t *testing.T) {
|
||||||
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
time.Sleep(200 * time.Millisecond)
|
time.Sleep(300 * time.Millisecond)
|
||||||
|
|
||||||
// Query again and now foo should have moved to the front of the line.
|
// Query again and now foo should have moved to the front of the line.
|
||||||
resp = httptest.NewRecorder()
|
resp = httptest.NewRecorder()
|
||||||
|
@ -320,7 +320,7 @@ func TestHealthServiceChecks_DistanceSort(t *testing.T) {
|
||||||
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
time.Sleep(200 * time.Millisecond)
|
time.Sleep(300 * time.Millisecond)
|
||||||
|
|
||||||
// Query again and now foo should have moved to the front of the line.
|
// Query again and now foo should have moved to the front of the line.
|
||||||
resp = httptest.NewRecorder()
|
resp = httptest.NewRecorder()
|
||||||
|
@ -487,7 +487,7 @@ func TestHealthServiceNodes_DistanceSort(t *testing.T) {
|
||||||
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
if err := srv.agent.RPC("Coordinate.Update", &arg, &out); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
time.Sleep(200 * time.Millisecond)
|
time.Sleep(300 * time.Millisecond)
|
||||||
|
|
||||||
// Query again and now foo should have moved to the front of the line.
|
// Query again and now foo should have moved to the front of the line.
|
||||||
resp = httptest.NewRecorder()
|
resp = httptest.NewRecorder()
|
||||||
|
|
Loading…
Reference in a new issue