From 35a9d8e943f49c63e5f1f93cfb3e06cf685e0100 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Tue, 30 Jun 2026 17:18:27 +0800 Subject: [PATCH] Allow initializing scan smoke during deploy --- deploy.sh | 4 ++++ tests/test_deployment_runtime_config.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/deploy.sh b/deploy.sh index 8d38e1ff..e040a893 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 '"stale_reason":"市场扫描快照正在初始化"'; then + echo "✅ $name initializing after attempt $i/$attempts" + return 0 + fi status="$(printf '%s' "$compact" | sed -n 's/.*"status":"\([^"]*\)".*/\1/p' | head -n 1)" echo " $name not ready attempt $i/$attempts http=${http_status:-unknown} status=${status:-unknown}" else diff --git a/tests/test_deployment_runtime_config.py b/tests/test_deployment_runtime_config.py index 62d8cdab..9e75c46b 100644 --- a/tests/test_deployment_runtime_config.py +++ b/tests/test_deployment_runtime_config.py @@ -278,6 +278,8 @@ def test_deploy_script_retries_startup_smoke_checks(): assert "wait_for_scan_terminal_snapshot()" in script assert '"status":"ready"' in script assert "http=401" in script + assert '"stale_reason":"市场扫描快照正在初始化"' in script + assert "initializing after attempt" in script assert 'wait_for_scan_terminal_snapshot "scan terminal snapshot" "http://127.0.0.1:3001/api/scan/terminal"' in script assert script.index("wait_for_scan_terminal_snapshot") < script.index("run_public_smoke_checks") assert 'smoke_check "healthz" "https://api.polyweather.top/healthz" 15 3 5' in script