From b1afac7c045523f0bc780f427ebdf5b0cca6cff1 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: Wed, 14 Aug 2024 16:28:35 +0545 Subject: [PATCH] fix test_daemon.py::test_analytics flakiness Turns out `iterative-telemetry` spends a long time trying to generate an id. Sometimes it gets frozen for a long time (>30s). --- tests/func/test_daemon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/func/test_daemon.py b/tests/func/test_daemon.py index 8255bc1fd3..dee91eea08 100644 --- a/tests/func/test_daemon.py +++ b/tests/func/test_daemon.py @@ -97,6 +97,10 @@ def test_analytics(tmp_path, server): } env.pop("DVC_TEST", None) env.pop("DVC_NO_ANALYTICS", None) + # The `iterative-telemetry` package calls `gh api` to generate a CI id. + # This might hang, possibly due to load on machine due to other tests running. + # Removing the GITHUB_ACTIONS env var avoids calling `gh api`. + env.pop("GITHUB_ACTIONS", None) output = subprocess.check_output( [*_get_dvc_args(), "config", "-l", "-vv"], @@ -113,7 +117,7 @@ def test_analytics(tmp_path, server): pid = int(match.group(1).strip()) with suppress(psutil.NoSuchProcess): - psutil.Process(pid).wait(timeout=30) + psutil.Process(pid).wait(timeout=10) log_contents = logfile.read_text(encoding="utf8") expected_line = (f"Process {pid} " if os.name != "nt" else "") + "exiting with 0"