Skip to content

fix: TestRedisBroker delivers freshly-published messages to subscribers with min_idle_time#2878

Open
ApusBerliozi wants to merge 2 commits into
ag2ai:mainfrom
ApusBerliozi:2848_fix_TestRedisBroker_message_delivery
Open

fix: TestRedisBroker delivers freshly-published messages to subscribers with min_idle_time#2878
ApusBerliozi wants to merge 2 commits into
ag2ai:mainfrom
ApusBerliozi:2848_fix_TestRedisBroker_message_delivery

Conversation

@ApusBerliozi
Copy link
Copy Markdown
Contributor

@ApusBerliozi ApusBerliozi commented May 19, 2026

Description

So, in order to "emulate" xautoclaim, I decided to add asyncio.wait_for in FakeProducer.publish, with timeout of 30 seconds (cause it's the maximum for pytest). I think it's a reasonable compromise, cause it will simulate how production environment would handle this situation. So, if min_idle_time is less than 30 seconds we will proceed with the call after some delay and if it isn't - we won't.

Fixes #2848

Type of change

  • Bug fix (a non-breaking change that resolves an issue)

Checklist

  • My code adheres to the style guidelines of this project (just lint shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running just test-coverage
  • I have ensured that static analysis tests are passing by running just static-analysis
  • I have included code examples to illustrate the modifications

@ApusBerliozi ApusBerliozi requested a review from Lancetnik as a code owner May 19, 2026 09:00
@github-actions github-actions Bot added the Redis Issues related to `faststream.redis` module and Redis features label May 19, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Redis Issues related to `faststream.redis` module and Redis features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: TestRedisBroker delivers freshly-published messages to subscribers with min_idle_time

1 participant