From a4bac135d95d8b6bfe2ca2dfb1e76ad14fe783b2 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 29 Jul 2022 11:11:54 -0400 Subject: [PATCH] Use `pytest-timeout` plug to try and prevent CI hang --- requirements-test.txt | 1 + tests/test_debugger.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/requirements-test.txt b/requirements-test.txt index 1d3cfad..c2b43c1 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,6 @@ pytest pytest-trio +pytest-timeout pdbpp mypy<0.920 trio_typing<0.7.0 diff --git a/tests/test_debugger.py b/tests/test_debugger.py index 8f396e7..27cc055 100644 --- a/tests/test_debugger.py +++ b/tests/test_debugger.py @@ -683,6 +683,7 @@ def test_multi_nested_subactors_error_through_nurseries( assert "NameError" in before +@pytest.mark.timeout(15) def test_root_nursery_cancels_before_child_releases_tty_lock( spawn, start_method, @@ -734,6 +735,7 @@ def test_root_nursery_cancels_before_child_releases_tty_lock( do_ctlc(child) child.sendline('c') + time.sleep(0.1) while True: try: @@ -741,6 +743,7 @@ def test_root_nursery_cancels_before_child_releases_tty_lock( break except pexpect.exceptions.TIMEOUT: child.sendline('c') + time.sleep(0.1) print('child was able to grab tty lock again?') if not timed_out_early: