Skip to content

Running sentry tests no longer hits redis rate limit #372

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 21 commits into from
Mar 12, 2021

Conversation

simzzz
Copy link
Contributor

@simzzz simzzz commented Jan 22, 2021

closes #357
After some research, I decided to go with the following changes:

  • Use SELECT to switch the Redis DB for each test, making sure tests don't mess it up for one another
  • Since tests still hit the rate limit even with SELECT I discovered that a common approach is running the tests in the database module sequentially. I used the serial_test crate for that.

@simzzz simzzz requested a review from elpiel January 22, 2021 14:42
@simzzz simzzz changed the title Tests now Running tests no longer hits rate limit Jan 25, 2021
@simzzz simzzz changed the title Running tests no longer hits rate limit Running sentry tests no longer hits redis rate limit Jan 25, 2021
Copy link
Member

@elpiel elpiel left a comment

Choose a reason for hiding this comment

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

This will still have issues because of the auth tests.

Make sure to create a Pool struct for the tests that will automatically release the Database once the test is done with them.

it should also Flush the Database before releasing it to the pool

https://docs.rs/deadpool

Copy link
Member

@elpiel elpiel left a comment

Choose a reason for hiding this comment

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

LGTM! Should be enough for our needs atm

@elpiel elpiel merged commit 033f5d9 into dev Mar 12, 2021
@elpiel elpiel linked an issue Mar 19, 2021 that may be closed by this pull request
3 tasks
@elpiel elpiel deleted the issue-357-rate-limit-in-tests branch March 19, 2021 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RateLimit and redis randomly failing tests
2 participants