Refactor TestStickerSetWithRequest tests#5161
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors TestStickerSetWithRequest to reduce CI flakiness under pytest-xdist by ensuring each worker operates on its own sticker set.
Changes:
- Introduce an autouse async fixture that creates (or reuses) a per-worker sticker set and exposes worker-scoped fixtures.
- Consolidate and rename several sticker-set tests to operate against the per-worker sticker set.
- Remove old shared sticker set fixtures from
conftest.pyand add an internal changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/_files/test_sticker.py | Creates per-worker sticker sets and refactors request-based sticker-set tests to use them. |
| tests/_files/conftest.py | Removes shared sticker-set fixtures/imports that are no longer needed after per-worker refactor. |
| changes/unreleased/5161.BXtxdWhwpuvW4duoMvVFUB.toml | Adds an internal unreleased entry describing the refactor. |
Member
Author
|
All affected tests are xfailing on all jobs here because of the flood limits, so my word is the only thing which verifies this.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4514
Should also fix the flaky tests plaguing the CI for the past month or so? It was really hard to test whether this worked, because of all the flood limits and concurrency issues running with pytest-xdist. I had to use my own bot and even then it was really easy to run into flood limits. All the
TestStickerSetWithRequesttests passed for my bot, including when I ran it concurrently with pytest-xdist.Each worker now makes its own sticker set, so there should be no race conditions when 2 tests modify the same sticker(set) at once.