TestCompactor_ShouldCompactAllUsersOnShardingEnabledButOnlyOneInstanceRunning fails intermittently on the arm64 -race CI job: the background userIndexUpdateLoop ticks every ~100ms in tests (via prepare()'s user-index strategy) and logs a ring error whenever no healthy instance exists — before the lifecycler is ACTIVE or during LEAVING at shutdown. Any tick landing in the test window leaks an extra line into the exact log-set assertion, failing with elements differ.
removeIgnoredLogs already suppresses two of the loop's log lines via map entries; the two error lines were missed because their variable err= payloads require regexes. This adds them:
ignoredLogStringsRegexList:= []*regexp.Regexp{
regexp.MustCompile(`^level=(info|debug|warn) component=cleaner .+$`),
regexp.MustCompile(`^level=info component=compactor msg="set state" .+$`),
regexp.MustCompile(`^level=error component=compactor msg="failed to check if compactor owns updating user index" err=.+$`),
regexp.MustCompile(`^level=error component=compactor msg="failed to update user index" err=.+$`),
}
Since all 14 exact log-set assertions in compactor_test.go and compactor_paritioning_test.go funnel through removeIgnoredLogs, this single change covers every sharding-enabled test exposed to the same race. Regexes were verified against real go-kit logfmt output, including the exact err="at least 1 live replicas required, could only find 0" line from the failed CI jobs. Test-only change; no production behavior modified.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
TestCompactor_ShouldCompactAllUsersOnShardingEnabledButOnlyOneInstanceRunning fails intermittently on the arm64 -race CI job: the background userIndexUpdateLoop ticks every ~100ms in tests (via prepare()'s user-index strategy) and logs a ring error whenever no healthy instance exists — before the lifecycler is ACTIVE or during LEAVING at shutdown. Any tick landing in the test window leaks an extra line into the exact log-set assertion, failing with elements differ.
removeIgnoredLogs already suppresses two of the loop's log lines via map entries; the two error lines were missed because their variable err= payloads require regexes. This adds them:
Since all 14 exact log-set assertions in compactor_test.go and compactor_paritioning_test.go funnel through removeIgnoredLogs, this single change covers every sharding-enabled test exposed to the same race. Regexes were verified against real go-kit logfmt output, including the exact err="at least 1 live replicas required, could only find 0" line from the failed CI jobs. Test-only change; no production behavior modified.
Checklist