From 4a73548065768e9afffca7a034d4d0ce8272f346 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Tue, 12 Jul 2022 09:52:26 +0200 Subject: [PATCH] Adds a timeout to Python tests that may wait forever Some E2E test for the CLN plugin have conditional waits that may wait forever if the code has a bug. Set a timeout for an early fail so we don't have to waste CI time. --- watchtower-plugin/tests/pyproject.toml | 1 + watchtower-plugin/tests/test.py | 1 + 2 files changed, 2 insertions(+) diff --git a/watchtower-plugin/tests/pyproject.toml b/watchtower-plugin/tests/pyproject.toml index 6cc72ff..56d2cd6 100644 --- a/watchtower-plugin/tests/pyproject.toml +++ b/watchtower-plugin/tests/pyproject.toml @@ -10,6 +10,7 @@ python = "^3.9" [tool.poetry.dev-dependencies] pytest = "^7.1.2" +pytest-timeout = "^2.1.0" pyln-testing = "^0.10.2" diff --git a/watchtower-plugin/tests/test.py b/watchtower-plugin/tests/test.py index d8a67cd..8e5030b 100644 --- a/watchtower-plugin/tests/test.py +++ b/watchtower-plugin/tests/test.py @@ -77,6 +77,7 @@ def test_watchtower(node_factory, bitcoind, teosd): assert penalty_txid in fund_txids +@pytest.mark.timeout(60) def test_unreachable_watchtower(node_factory, bitcoind, teosd): # Set the max retry interval to 1 sec so we know how much to wait for the next retry attempt max_interval_time = 1