Skip to content

Add integration tests for the compactor - #7962

Open
cvas22 wants to merge 3 commits into
cortexproject:masterfrom
cvas22:test/3096-compactor-integration
Open

cvas22 wants to merge 3 commits into
cortexproject:masterfrom
cvas22:test/3096-compactor-integration

Conversation

@cvas22

@cvas22 cvas22 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Adds TestCompactorMergesBlocks, so the compactor finally has its own integration test. It uploads level 1 blocks straight to the bucket and runs the compactor, once with two adjacent blocks that should become one block in the next range, and once with two overlapping blocks that should be merged vertically. Then it checks the compacted block's meta, waits for the cleaner to remove the source blocks, and queries the result through the store-gateway.

Which issue(s) this PR fixes:
Fixes #3096

I used some help from AI, please don't yell at me. Thx.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

Upload level 1 blocks to the bucket and check that the compactor merges
adjacent blocks into the next range and overlapping blocks vertically,
that the cleaner removes the source blocks, and that the compacted block
can be queried through the store-gateway.

Fixes cortexproject#3096

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@cvas22
cvas22 requested a review from a team as a code owner November 21, 2026 04:36
@cvas22
cvas22 requested a review from SungJin1212 November 21, 2026 04:36
The compactor drops the ingester ID from the external labels and refuses
to upload a block without any, so add the tenant ID like ingesters do. The
planner also leaves the most recent block alone, so the adjacent case needs
a newer block for the two older ones to be compacted.

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
count_over_time drops the metric name, so give each series its own label
to avoid a duplicate labelset.

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration tests for compactor

1 participant