Skip to content

Commit

Permalink
timeout when asynchronous tests are broken. it's all mocked so 2 seco…
Browse files Browse the repository at this point in the history
…nds are very long already.
  • Loading branch information
gluap committed Dec 26, 2019
1 parent abf70aa commit a9dbe8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyduofern/tests/test_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import os
import re
import tempfile
import time

import pytest

Expand Down Expand Up @@ -154,10 +155,13 @@ def test_init_against_mocked_stick(event_loop, replayfile):

# if proto.transport.next_is_sent():
# proto.transport.write(bytearray.fromhex(proto.transport.replay[-1][1].strip()))
start_time = time.time()
@asyncio.coroutine
def feedback_loop():
while proto.transport.replay:
yield
if time.time() - start_time > 3:
raise TimeoutError("Mock test should not take longer than 30 seconds, asynchronous loop must be stuck")

if proto.transport.next_is_action():
asyncio.ensure_future(proto.transport.actions())
Expand Down

0 comments on commit a9dbe8e

Please sign in to comment.