We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2320246 commit 63eeb44Copy full SHA for 63eeb44
1 file changed
tests/units/test_app.py
@@ -1341,9 +1341,12 @@ async def _drain_background_tasks(app: App):
1341
The gathered background task results.
1342
"""
1343
tasks = tuple(app._background_tasks)
1344
- if tasks:
1345
- return await asyncio.gather(*tasks, return_exceptions=True)
1346
- return []
+ results = await asyncio.gather(*tasks, return_exceptions=True) if tasks else []
+ if environment.REFLEX_OPLOCK_ENABLED.get():
+ # Redis oplocks can keep completed background-task writes in the local
1347
+ # lease cache until the manager is closed.
1348
+ await app.state_manager.close()
1349
+ return results
1350
1351
1352
@pytest.mark.asyncio
0 commit comments