Skip to content

Commit

Permalink
TestQuerierWithBlocksStorageOnMissingBlocksFromStorage: start compact…
Browse files Browse the repository at this point in the history
…or earlier (#6815) (#6841)

This test is a little bit flaky. Starting the compactor first, so it can do its user cleanup on startup, makes sure the store-gateway can discover the bucket index. Otherwise, if the compactro startup takes longer than 1-2 seconds, the store-gateway can discover the blocks

Follow-up of 6779

Signed-off-by: Dimitar Dimitrov <[email protected]>
(cherry picked from commit 177c17e)

Co-authored-by: Dimitar Dimitrov <[email protected]>
  • Loading branch information
grafanabot and dimitarvdimitrov authored Dec 6, 2023
1 parent 1ee593c commit 2a56165
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions integration/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,10 @@ func TestQuerierWithBlocksStorageOnMissingBlocksFromStorage(t *testing.T) {
require.NoError(t, ingester.WaitSumMetrics(e2e.Equals(1), "cortex_ingester_memory_series_removed_total"))
require.NoError(t, ingester.WaitSumMetrics(e2e.Equals(1), "cortex_ingester_memory_series"))

// Start the compactor to have the bucket index created before querying.
compactor := e2emimir.NewCompactor("compactor", consul.NetworkHTTPEndpoint(), flags)
require.NoError(t, s.StartAndWaitReady(compactor))

// Start the querier and store-gateway, and configure them to frequently sync blocks fast enough to trigger consistency check
// We will induce an error in the store gateway by deleting blocks and the querier ignores the direct error
// and relies on checking that all blocks were queried. However this consistency check will skip most recent
Expand All @@ -821,10 +825,6 @@ func TestQuerierWithBlocksStorageOnMissingBlocksFromStorage(t *testing.T) {
require.NoError(t, querier.WaitSumMetrics(e2e.Equals(512*2), "cortex_ring_tokens_total"))
require.NoError(t, storeGateway.WaitSumMetrics(e2e.Equals(512), "cortex_ring_tokens_total"))

// Start the compactor to have the bucket index created before querying.
compactor := e2emimir.NewCompactor("compactor", consul.NetworkHTTPEndpoint(), flags)
require.NoError(t, s.StartAndWaitReady(compactor))

// Wait until the blocks are old enough for consistency check
// 1 sync on startup, 3 to go over the consistency check limit explained above
require.NoError(t, storeGateway.WaitSumMetrics(e2e.GreaterOrEqual(1+3), "cortex_blocks_meta_syncs_total"))
Expand Down

0 comments on commit 2a56165

Please sign in to comment.