From bf313d92aaa6ed1affd22b3dd007461f5d3d6d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Fri, 19 Nov 2021 20:41:44 +0545 Subject: [PATCH] exp init: timeout prompts' test The `exp init` tests may just keep waiting on the prompts blocking tests. The blocking of prompts is likely a failure in tests setup or a bug in the implementation. It's hard to find out these failures or avoid it. If they take longer than 1 second, they most likely have failed as most of test takes 0.1 second at max. --- setup.cfg | 1 + tests/func/experiments/test_init.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/setup.cfg b/setup.cfg index 57cfb9e46..9987460e4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -127,6 +127,7 @@ tests = pytest-docker==0.10.3; python_version < '3.10' or sys_platform != 'win32' flaky==3.7.0 mock==4.0.3 + pytest-timeout==2.0.1 rangehttpserver==1.2.0 mock-ssh-server==0.9.1 wget==3.2 diff --git a/tests/func/experiments/test_init.py b/tests/func/experiments/test_init.py index e55e7d66d..f8a14e887 100644 --- a/tests/func/experiments/test_init.py +++ b/tests/func/experiments/test_init.py @@ -9,6 +9,9 @@ from dvc.main import main from dvc.repo.experiments.init import init from dvc.stage.exceptions import DuplicateStageName +# the tests may hang on prompts on failure +pytestmark = pytest.mark.timeout(1) + def test_init_simple(tmp_dir, scm, dvc, capsys): tmp_dir.gen(