Allow initializing scan smoke during deploy
This commit is contained in:
@@ -297,6 +297,10 @@ wait_for_scan_terminal_snapshot() {
|
|||||||
echo "✅ $name ready after attempt $i/$attempts"
|
echo "✅ $name ready after attempt $i/$attempts"
|
||||||
return 0
|
return 0
|
||||||
fi
|
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)"
|
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}"
|
echo " $name not ready attempt $i/$attempts http=${http_status:-unknown} status=${status:-unknown}"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -278,6 +278,8 @@ def test_deploy_script_retries_startup_smoke_checks():
|
|||||||
assert "wait_for_scan_terminal_snapshot()" in script
|
assert "wait_for_scan_terminal_snapshot()" in script
|
||||||
assert '"status":"ready"' in script
|
assert '"status":"ready"' in script
|
||||||
assert "http=401" 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 '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 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
|
assert 'smoke_check "healthz" "https://api.polyweather.top/healthz" 15 3 5' in script
|
||||||
|
|||||||
Reference in New Issue
Block a user