diff --git a/tests/core/server/test_dos.py b/tests/core/server/test_dos.py index de87635e356c..a8c369612619 100644 --- a/tests/core/server/test_dos.py +++ b/tests/core/server/test_dos.py @@ -201,8 +201,10 @@ async def test_spam_tx(self, setup_two_nodes_fixture, self_hostname): # Remove outbound rate limiter to test inbound limits ws_con.outbound_rate_limiter = RateLimiter(incoming=True, percentage_of_limit=10000) - for i in range(6000): - await ws_con._send_message(new_tx_message) + with pytest.raises(ConnectionResetError): + for i in range(6000): + await ws_con._send_message(new_tx_message) + await asyncio.sleep(0) await asyncio.sleep(1) def is_closed():