Skip to content

Fixed flaky TestMultitenantAlertmanager_SyncOnRingTopologyChanges #4418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

pracucci
Copy link
Contributor

What this PR does:
Most CI flaky failures are due to TestMultitenantAlertmanager_SyncOnRingTopologyChanges, so I took some time to investigate it. The reason of the flakyness is that when MultitenantAlertmanager.run() is started, the ring change done by the test may have already happened and so the ring state change will not be detected by run(). To validate this theory, I've added a time.Sleep() at the beginning of run(): if you do it, the test always fail, while it shouldn't.

Instead of adding a sleep in the test, in this PR I'm proposing to initialise ringLastState in the starting() function, right after we've synched the config, which is actually more accurate.

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

Checklist

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

@pracucci pracucci force-pushed the fix-flaky-alertmanager-test branch from 4cb6795 to f7ef3a8 Compare August 12, 2021 07:01
@pracucci pracucci merged commit 32b558b into master Aug 12, 2021
alvinlin123 pushed a commit to ac1214/cortex that referenced this pull request Jan 14, 2022
@friedrichg friedrichg deleted the fix-flaky-alertmanager-test branch December 11, 2023 08:54
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.

Flaky TestMultitenantAlertmanager_SyncOnRingTopologyChanges
2 participants