Skip to content

fix flaky regex resolver e2e tests#7506

Merged
friedrichg merged 2 commits into
cortexproject:masterfrom
SungJin1212:fix-flaky-regex-resolver-e2etests
May 11, 2026
Merged

fix flaky regex resolver e2e tests#7506
friedrichg merged 2 commits into
cortexproject:masterfrom
SungJin1212:fix-flaky-regex-resolver-e2etests

Conversation

@SungJin1212
Copy link
Copy Markdown
Member

This PR fixes flaky regex resolver e2e tests. Previously, the tests waited for cortex_regex_resolver_last_update_run_timestamp_seconds > 0, but this metric can be updated before blocks are uploaded to the bucket, causing the test to proceed with an empty knownUsers list. Instead, we now wait for cortex_regex_resolver_discovered_users == N, which guarantees that the resolver has scanned the bucket and discovered all expected tenants.

    querier_tenant_federation_test.go:226: 
        	Error Trace:	/home/runner/work/cortex/cortex/integration/querier_tenant_federation_test.go:226
        	Error:      	Not equal: 
        	            	expected: model.Vector{(*model.Sample)(0xa733693d620)}
        	            	actual  : model.Vector{}
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,10 +1,2 @@
        	            	-(model.Vector) (len=1) {
        	            	- (*model.Sample)({
        	            	-  Metric: (model.Metric) (len=1) {
        	            	-   (model.LabelName) (len=8) "__name__": (model.LabelValue) (len=8) "series_1"
        	            	-  },
        	            	-  Value: (model.SampleValue) 0.7491711903904605,
        	            	-  Timestamp: (model.Time) 1778498925016,
        	            	-  Histogram: (*model.SampleHistogram)(<nil>)
        	            	- })
        	            	+(model.Vector) {
        	            	 }
        	Test:       	Test_TenantFederationRegexResolver_WhenSingleTenantMatched

https://github.com/cortexproject/cortex/actions/runs/25666915848/job/75342583581?pr=7462

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]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212 SungJin1212 force-pushed the fix-flaky-regex-resolver-e2etests branch from 2a776f4 to f37d431 Compare May 11, 2026 12:40
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 11, 2026
@friedrichg friedrichg merged commit 0ecd21b into cortexproject:master May 11, 2026
68 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size/S type/flaky-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants