Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test_state_manager_lock_warning_threshold_contend expectations
Browse files Browse the repository at this point in the history
Now that all substates are persisted together, there is only 1 warning message
expected, not 7
masenf committed Dec 13, 2024

Verified

This commit was signed with the committer’s verified signature.
masenf Masen Furer
1 parent f8bfc78 commit c347dc8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/units/test_state.py
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@

import reflex as rx
import reflex.config
import reflex.utils.console
from reflex import constants
from reflex.app import App
from reflex.base import Base
@@ -1857,7 +1858,7 @@ async def test_state_manager_lock_warning_threshold_contend(
substate_token_redis: A token + substate name for looking up in state manager.
mocker: Pytest mocker object.
"""
console_warn = mocker.patch("reflex.utils.console.warn")
console_warn = mocker.spy(reflex.utils.console, "warn")

state_manager_redis.lock_expiration = LOCK_EXPIRATION
state_manager_redis.lock_warning_threshold = LOCK_WARNING_THRESHOLD
@@ -1875,7 +1876,7 @@ async def _coro_blocker():

await tasks[0]
console_warn.assert_called()
assert console_warn.call_count == 7
assert console_warn.call_count == 1


class CopyingAsyncMock(AsyncMock):

0 comments on commit c347dc8

Please sign in to comment.