Skip to content

Refactor TestStickerSetWithRequest tests#5161

Merged
harshil21 merged 5 commits intomasterfrom
sticker-tests-refactor
Mar 16, 2026
Merged

Refactor TestStickerSetWithRequest tests#5161
harshil21 merged 5 commits intomasterfrom
sticker-tests-refactor

Conversation

@harshil21
Copy link
Member

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 TestStickerSetWithRequest tests 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.

@harshil21 harshil21 requested review from aelkheir and Copilot March 8, 2026 08:32
@harshil21 harshil21 added the ⚙️ tests affected functionality: tests label Mar 8, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.py and 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.

@harshil21
Copy link
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..

@harshil21 harshil21 requested a review from Poolitzer March 15, 2026 23:10
@harshil21 harshil21 merged commit 66e4103 into master Mar 16, 2026
28 checks passed
@harshil21 harshil21 deleted the sticker-tests-refactor branch March 16, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️ tests affected functionality: tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor test_sticker.py since sticker sets can now hold static, animated, and video altogether.

2 participants