Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: deflake acceptance/status-server #29492

Merged
merged 1 commit into from
Sep 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkg/cmd/roachtest/status_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (
"fmt"
"io/ioutil"
"net/http"
"time"

"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/server/serverpb"
"github.com/cockroachdb/cockroach/pkg/util/httputil"
"github.com/cockroachdb/cockroach/pkg/util/retry"
)

func runStatusServer(ctx context.Context, t *test, c *cluster) {
Expand All @@ -35,7 +37,12 @@ func runStatusServer(ctx context.Context, t *test, c *cluster) {
for i, addr := range c.ExternalAdminUIAddr(ctx, c.All()) {
var details serverpb.DetailsResponse
url := `http://` + addr + `/_status/details/local`
if err := httputil.GetJSON(http.Client{}, url, &details); err != nil {
// Use a retry-loop when populating the maps because we might be trying to
// talk to the servers before they are responding to status requests
// (resulting in 404's).
if err := retry.ForDuration(10*time.Second, func() error {
return httputil.GetJSON(http.Client{}, url, &details)
}); err != nil {
t.Fatal(err)
}
idMap[i+1] = details.NodeID
Expand Down