Skip to content

Commit dd99813

Browse files
committed
test: assert retry count in exhausted-retries test
1 parent 23dc2f2 commit dd99813

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_connection_manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ async def mock_connect_internal(migrating_from_list=None, **kwargs):
8383
async def test_raises_after_all_retries_exhausted(self, connection_manager):
8484
"""When all retries are exhausted, connect() should raise SfuJoinError."""
8585
cm = connection_manager
86+
call_count = 0
8687

8788
async def always_fail(migrating_from_list=None, **kwargs):
89+
nonlocal call_count
90+
call_count += 1
8891
mock_join_response = MagicMock()
8992
mock_join_response.credentials.server.edge_name = "sfu-node-1"
9093
cm.join_response = mock_join_response
@@ -99,6 +102,8 @@ async def always_fail(migrating_from_list=None, **kwargs):
99102
with pytest.raises(SfuJoinError):
100103
await cm.connect()
101104

105+
assert call_count == 2 # 1 initial + 1 retry
106+
102107
@pytest.mark.asyncio
103108
async def test_non_retryable_error_propagates_immediately(self, connection_manager):
104109
"""Non-retryable errors should not trigger retry."""

0 commit comments

Comments
 (0)