From ab0c3dd68d3f260f22512a9f15defec85a25ada7 Mon Sep 17 00:00:00 2001 From: opencode-agent Date: Thu, 6 Aug 2026 15:48:02 +0000 Subject: [PATCH] test(ci): add timeout to _gh_available to prevent hang on Forgejo runner --- tests/test_pipeline_status_tool.py | 3 ++- tests/test_project_status_tool.py | 3 ++- tests/test_spec_status_tool.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_pipeline_status_tool.py b/tests/test_pipeline_status_tool.py index e34ec25..fba656c 100644 --- a/tests/test_pipeline_status_tool.py +++ b/tests/test_pipeline_status_tool.py @@ -42,10 +42,11 @@ def _gh_available() -> bool: ["gh", "auth", "status"], capture_output=True, check=False, + timeout=10, ).returncode == 0 ) - except FileNotFoundError: + except (FileNotFoundError, subprocess.TimeoutExpired): return False diff --git a/tests/test_project_status_tool.py b/tests/test_project_status_tool.py index 1a7cb8d..8107ce4 100644 --- a/tests/test_project_status_tool.py +++ b/tests/test_project_status_tool.py @@ -39,10 +39,11 @@ def _gh_available() -> bool: ["gh", "auth", "status"], capture_output=True, check=False, + timeout=10, ).returncode == 0 ) - except FileNotFoundError: + except (FileNotFoundError, subprocess.TimeoutExpired): return False diff --git a/tests/test_spec_status_tool.py b/tests/test_spec_status_tool.py index c60c0e9..4dbac2c 100644 --- a/tests/test_spec_status_tool.py +++ b/tests/test_spec_status_tool.py @@ -43,10 +43,11 @@ def _gh_available() -> bool: ["gh", "auth", "status"], capture_output=True, check=False, + timeout=10, ).returncode == 0 ) - except FileNotFoundError: + except (FileNotFoundError, subprocess.TimeoutExpired): return False