fix(recovery): bound 110 pressure readback
Some checks failed
CD Pipeline / workflow-shape (push) Has been cancelled
CD Pipeline / cancel-stale-cd (push) Has been cancelled
CD Pipeline / tests (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
CD Pipeline / post-deploy-checks (push) Has been cancelled

This commit is contained in:
Your Name
2026-07-01 13:37:22 +08:00
parent 12b78453cf
commit bc46edc01c
7 changed files with 95 additions and 27 deletions

View File

@@ -10,6 +10,7 @@ CD_WORKFLOW = ROOT / ".gitea" / "workflows" / "cd.yaml"
HARBOR_110_REPAIR_WORKFLOW = (
ROOT / ".gitea" / "workflows" / "harbor-110-local-repair.yaml"
)
WAIT_HOST_PRESSURE = ROOT / "scripts" / "ci" / "wait-host-web-build-pressure.sh"
def _workflow_text() -> str:
@@ -117,6 +118,15 @@ def test_harbor_login_has_public_route_retry_and_safe_secret_transport() -> None
assert "--password " not in block
def test_host_pressure_gate_ignores_stale_docker_stats_for_cpu_attribution() -> None:
text = WAIT_HOST_PRESSURE.read_text(encoding="utf-8")
assert "MAX_DOCKER_METRICS_AGE_SECONDS" in text
assert 'mtime="$(stat -c %Y "$DOCKER_METRICS_FILE"' in text
assert 'if [ "$age" -gt "$MAX_DOCKER_METRICS_AGE_SECONDS" ]; then' in text
assert "docker_container_cpu_cores" in text
def test_harbor_110_local_repair_workflow_is_dispatch_only_and_bounded() -> None:
text = HARBOR_110_REPAIR_WORKFLOW.read_text(encoding="utf-8")