Skip to content

fix a flaky test in purger#2841

Merged
pracucci merged 1 commit into
cortexproject:masterfrom
sandeepsukhani:fix-flaky-purger-test
Jul 8, 2020
Merged

fix a flaky test in purger#2841
pracucci merged 1 commit into
cortexproject:masterfrom
sandeepsukhani:fix-flaky-purger-test

Conversation

@sandeepsukhani

Copy link
Copy Markdown
Contributor

What this PR does:
In TestPurger_Metrics test I was starting the purger service here after pulling the delete requests for processing here which usually should never happen because we always start the service first. This was done to capture an expected metric value.
This was causing Purger to work in an unexpected way causing it to fail the test sometimes. I have changed the test to stop existing purger and create a new one to start the service for delete request processing.

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

Checklist

  • Tests updated

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

@pracucci pracucci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix! LGTM


// start loop to process requests
// stop the existing purger
require.NoError(t, services.StopAndAwaitTerminated(context.Background(), purger))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

At the beginning of the test there's a deferred call to purger.StopAsync(). Given we're now terminating it here, I believe that call should be removed.

@jtlisi jtlisi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@pracucci pracucci merged commit dc51be3 into cortexproject:master Jul 8, 2020
@sandeepsukhani sandeepsukhani deleted the fix-flaky-purger-test branch January 7, 2021 05: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.

Flake in TestPurger_Metrics

3 participants