Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Le <[email protected]>
  • Loading branch information
CharlieTLe committed Oct 27, 2024
1 parent d711e1b commit 6a3b4b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5315,12 +5315,14 @@ func Test_Ingester_ModeHandler(t *testing.T) {

require.Equal(t, testData.expectedResponse, response.Code)
require.Equal(t, testData.expectedState, i.lifecycler.GetState())

err = i.CheckReady(context.Background())
if testData.expectedIsReady {
require.NoError(t, err)
// Wait for instance to own tokens
test.Poll(t, 1*time.Second, nil, func() interface{} {
return i.CheckReady(context.Background())
})
require.NoError(t, i.CheckReady(context.Background()))
} else {
require.NotNil(t, err)
require.NotNil(t, i.CheckReady(context.Background()))
}
})
}
Expand Down

0 comments on commit 6a3b4b4

Please sign in to comment.