From da53ce5d2f9db36c2b1a63d3c15f3be356658369 Mon Sep 17 00:00:00 2001 From: Martin Molinero Date: Wed, 26 Aug 2026 19:28:02 -0300 Subject: [PATCH] bug: increase timeouts for slow steps in CLI regression test The end-to-end CLI test used the default 120s timeout for `lean report` and `lean cloud backtest`, whose duration depends on the LEAN Docker image rendering time and the cloud backtest queue. Raise them to 600s, matching `lean data generate`, to avoid spurious CI failures. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_017m9ymW3MmXws555rUWzPyH --- tests/test_cli.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 485352a3..be6ee579 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -263,17 +263,19 @@ def test_cli() -> None: run_command(["lean", "backtest", csharp_project_name], cwd=test_dir, expected_return_code=1) # Generate reports + # Report generation runs in the LEAN Docker image and its rendering time varies a lot between runs, + # so we use a larger timeout to avoid spurious failures python_results_file = next(f for f in python_backtest_dirs[0].iterdir() if f.suffix == ".json" and f.stem.isdigit()) run_command(["lean", "report", "--backtest-results", str(python_results_file), - "--report-destination", "python.html"], cwd=test_dir) + "--report-destination", "python.html"], cwd=test_dir, timeout=600) csharp_results_file = next(f for f in csharp_backtest_dirs[0].iterdir() if f.suffix == ".json" and f.stem.isdigit()) run_command(["lean", "report", "--backtest-results", str(csharp_results_file), - "--report-destination", "csharp.html"], cwd=test_dir) + "--report-destination", "csharp.html"], cwd=test_dir, timeout=600) assert (test_dir / "python.html").is_file() assert (test_dir / "csharp.html").is_file() @@ -299,10 +301,11 @@ def test_cli() -> None: (csharp_project_dir / "Main.cs").is_file() # Run Python backtest in the cloud - run_command(["lean", "cloud", "backtest", python_project_name], cwd=test_dir) + # Cloud backtests depend on the cloud queue and compile times, so we use a larger timeout to avoid spurious failures + run_command(["lean", "cloud", "backtest", python_project_name], cwd=test_dir, timeout=600) # Run C# backtest in the cloud - run_command(["lean", "cloud", "backtest", csharp_project_name], cwd=test_dir) + run_command(["lean", "cloud", "backtest", csharp_project_name], cwd=test_dir, timeout=600) # Log out run_command(["lean", "logout"])