Skip to content

Conversation

SungJin1212
Copy link
Member

@SungJin1212 SungJin1212 commented Sep 26, 2025

Fix flaky test TestPerLabelsetDiscardedSeriesTracker.

How to reproduce

go test -count=100 -race -run TestPerLabelsetDiscardedSeriesTracker ./pkg/util/discardedseries

--- FAIL: TestPerLabelsetDiscardedSeriesTracker (0.00s)
    perlabelset_tracker_test.go:117: 
        	Error Trace:	/__w/cortex/cortex/pkg/util/discardedseries/perlabelset_tracker_test.go:117
        	            				/__w/cortex/cortex/pkg/util/discardedseries/perlabelset_tracker_test.go:84
        	Error:      	Not equal: 
        	            	expected: 0
        	            	actual  : 1
        	Test:       	TestPerLabelsetDiscardedSeriesTracker
FAIL

The reason is that all users share labelsetsToDelete. When processing user2, the labelSetId for user1 could be deleted.
Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@yeya24 yeya24 merged commit 1d7be73 into cortexproject:master Sep 29, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants