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