fix test_daemon.py::test_analytics flakiness (#10523)

Turns out `iterative-telemetry` spends a long time trying to
generate an id. Sometimes it gets frozen for a long time (>30s).
This commit is contained in:
skshetry
2024-08-14 16:55:18 +05:45
committed by GitHub
parent b9bcb45aaa
commit fd3b43df05
+6 -1
View File
@@ -97,6 +97,11 @@ 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 especially on Windows,
# possibly due to system load from the running tests.
# 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 +118,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"