fix(ci): wait for final B5 database readiness
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 1m36s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped

This commit is contained in:
ogt
2026-07-15 07:12:14 +08:00
parent 4b18c2062b
commit edda3a5b23
2 changed files with 40 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
CD_WORKFLOW = ROOT / ".gitea" / "workflows" / "cd.yaml"
def test_b5_waits_for_final_postmaster_and_same_network_client() -> None:
workflow = CD_WORKFLOW.read_text(encoding="utf-8")
b5 = workflow.split("- name: Integration Tests (B5 — 真實 DB)", 1)[1]
b5 = b5.split("- name: Clean Test Workspace Artifacts", 1)[0]
assert "PostgreSQL init process complete; ready for start up." in b5
assert 'B5_CLIENT_READY=0' in b5
assert "-v ON_ERROR_STOP=1 -Atqc 'SELECT 1'" in b5
assert "b5_pg_test_client_network_not_ready" in b5
assert "inspect_b5_final_postmaster_and_test_network_then_retry_cd" in b5
assert b5.index("B5_CLIENT_READY=0") < b5.index("setup_test_schema.sql")