From 26323846a8f60282ae318bab2f31c670eb571092 Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Fri, 16 Oct 2026 21:47:34 +0900 Subject: [PATCH 1/2] fix: give the theme commands a longer timeout `theme available` and `theme install` make Fess reach the remote theme repository while handling the request, which regularly exceeds the 5 second default client timeout (CI failed with "Network error: timed out" on the available-themes test). Use a 60 second timeout for both. --- src/fessctl/commands/theme.py | 8 ++++++-- tests/unit/test_theme.py | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/fessctl/commands/theme.py b/src/fessctl/commands/theme.py index 25831a6..1a700bc 100644 --- a/src/fessctl/commands/theme.py +++ b/src/fessctl/commands/theme.py @@ -9,6 +9,10 @@ theme_app = typer.Typer() +# Fess fetches the theme list and the theme archive from a remote repository +# while serving these requests, which can take longer than the default timeout. +REMOTE_TIMEOUT = 60.0 + @theme_app.command("available") def available_themes( @@ -19,7 +23,7 @@ def available_themes( """ List the themes that can be installed (requires Fess 15.9+). """ - client = FessAPIClient(Settings()) + client = FessAPIClient(Settings(), timeout=REMOTE_TIMEOUT) result = client.get_available_themes() status = result.get("response", {}).get("status", 1) @@ -54,7 +58,7 @@ def install_theme( """ Install a theme by name and version (requires Fess 15.9+). """ - client = FessAPIClient(Settings()) + client = FessAPIClient(Settings(), timeout=REMOTE_TIMEOUT) result = client.install_theme(name, version) status = result.get("response", {}).get("status", 1) diff --git a/tests/unit/test_theme.py b/tests/unit/test_theme.py index 7d61c5d..427f5b8 100644 --- a/tests/unit/test_theme.py +++ b/tests/unit/test_theme.py @@ -63,3 +63,17 @@ def test_install_failure_exits_with_status(self, mock_client_class, runner): assert result.exit_code == 1 assert "HTTP 404" in result.stdout + + +class TestThemeTimeout: + @pytest.mark.parametrize("args", [["available"], ["install", "filesearch", "15.9.4"]]) + @patch("fessctl.commands.theme.FessAPIClient") + def test_remote_calls_use_a_long_timeout(self, mock_client_class, runner, args): + mock_client = Mock() + mock_client.get_available_themes.return_value = {"response": {"status": 0, "themes": []}} + mock_client.install_theme.return_value = {"response": {"status": 0}} + mock_client_class.return_value = mock_client + + runner.invoke(theme_app, args) + + assert mock_client_class.call_args.kwargs["timeout"] >= 60 From 850543662ac19f3a7e02a373151621ea4156d67c Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Fri, 16 Oct 2026 22:01:30 +0900 Subject: [PATCH 2/2] ci: run the tests for pull requests that target any branch The pull_request trigger was limited to main, so a pull request stacked on another branch got no checks. Drop the branch filter; pushes are still limited to main, so a branch push does not build twice. --- .github/workflows/run-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index fa257c3..b3dd423 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -5,8 +5,6 @@ on: branches: - main pull_request: - branches: - - main jobs: test: