Skip to content

Commit

Permalink
server: deflake TestStatusEngineStatsJson
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
knz committed Mar 30, 2023
1 parent 56e890f commit 78d8117
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/server/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,14 @@ func TestStatusEngineStatsJson(t *testing.T) {
defer s.Stopper().Stop(context.Background())

var engineStats serverpb.EngineStatsResponse
if err := getStatusJSONProto(s, "enginestats/local", &engineStats); err != nil {
t.Fatal(err)
}
// Using SucceedsSoon because we have seen in the wild that
// occasionally requests don't go through with error "transport:
// error while dialing: connection interrupted (did the remote node
// shut down or are there networking issues?)"
testutils.SucceedsSoon(t, func() error {
return getStatusJSONProto(s, "enginestats/local", &engineStats)
})

if len(engineStats.Stats) != 1 {
t.Fatal(errors.Errorf("expected one engine stats, got: %v", engineStats))
}
Expand Down

0 comments on commit 78d8117

Please sign in to comment.