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

test: Ensure ingester is active in ring before tests #10528

Merged
merged 1 commit into from
Jan 28, 2025
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: 5 additions & 4 deletions pkg/ingester/downscale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ func TestIngester_PrepareInstanceRingDownscaleHandler(t *testing.T) {
require.NoError(t, services.StopAndAwaitTerminated(context.Background(), i))
})

// Wait until it's healthy
test.Poll(t, 5*time.Second, 1, func() interface{} {
return i.lifecycler.HealthyInstancesCount()
})
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

// Tests require that we've joined the ring so ensure that here.
require.NoError(t, ring.WaitInstanceState(ctx, ingestersRing, cfg.IngesterRing.InstanceID, ring.ACTIVE))
}

return i, ingestersRing
Expand Down