From 5bad2ec3988ed1d7449a6a2f2e2e4178cec6a342 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Tue, 30 Jun 2026 18:39:13 +0800 Subject: [PATCH] Accept stale scan snapshot in deploy smoke --- deploy.sh | 6 +++++- tests/test_deployment_runtime_config.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index e040a893..12f67ab7 100644 --- a/deploy.sh +++ b/deploy.sh @@ -297,6 +297,10 @@ wait_for_scan_terminal_snapshot() { echo "✅ $name ready after attempt $i/$attempts" return 0 fi + if printf '%s' "$compact" | grep -q '"status":"stale"'; then + echo "✅ $name stale snapshot available after attempt $i/$attempts" + return 0 + fi if printf '%s' "$compact" | grep -q '"stale_reason":"市场扫描快照正在初始化"'; then echo "✅ $name initializing after attempt $i/$attempts" return 0 @@ -311,7 +315,7 @@ wait_for_scan_terminal_snapshot() { fi done - echo "❌ $name did not return status=ready or http=401" + echo "❌ $name did not return status=ready/stale or http=401" return 1 } diff --git a/tests/test_deployment_runtime_config.py b/tests/test_deployment_runtime_config.py index 9e75c46b..f7b61a84 100644 --- a/tests/test_deployment_runtime_config.py +++ b/tests/test_deployment_runtime_config.py @@ -277,6 +277,8 @@ def test_deploy_script_retries_startup_smoke_checks(): assert "smoke_check()" in script assert "wait_for_scan_terminal_snapshot()" in script assert '"status":"ready"' in script + assert '"status":"stale"' in script + assert "stale snapshot available" in script assert "http=401" in script assert '"stale_reason":"市场扫描快照正在初始化"' in script assert "initializing after attempt" in script