Skip to content

ci(cypress): stop waiting on an API container that already died - #351

Merged
jirhiker merged 1 commit into
stagingfrom
ci/cypress-seed-reference-data
Aug 21, 2026
Merged

ci(cypress): stop waiting on an API container that already died#351
jirhiker merged 1 commit into
stagingfrom
ci/cypress-seed-reference-data

Conversation

@jirhiker

Copy link
Copy Markdown
Member

What

The Cypress job's readiness probe polled http://localhost:8000/docs behind a flat timeout 720:

timeout 720 bash -c 'until curl -sf http://localhost:8000/docs; do ... sleep 3; done'

When the API aborts during startup, nothing is ever going to answer, so the job printed "FastAPI not up yet, retrying..." for twelve minutes and then died with exit 124 — no API logs, no indication of what actually went wrong. That is exactly how the recent run of #350 failed, and the same shape of failure hit task/bdms-1156-evaluate-and-determine-public-pages before it.

This checks whether the app container is still running between polls and bails out immediately with docker compose logs app when it is not. A startup failure now surfaces in seconds with the traceback visible, and the genuine wait budget drops from 720s to 180s.

Note on the underlying outage

This only improves the diagnostics; it does not make a broken API start. The actual cause of the current red run is a backend seeding bug — ensure_seed_prereqs skipped loading core/lexicon.json because a migration had inserted one lexicon term, so the startup seed died on an empty organization category. That is fixed in DataIntegrationGroup/OcotilloAPI#869; this job stays red until that lands.

Testing

Not exercised end to end here — verifying it needs a run where the API dies during startup, which is precisely what OcotilloAPI#869 removes. The YAML parses and the shell is straight POSIX sh; the fail-fast branch is the one that fires on the current breakage, so the next run on this branch before the backend fix merges will demonstrate it.

🤖 Generated with Claude Code

The readiness probe polled http://localhost:8000/docs for a flat 720s.
When the API aborts during startup — as it does when its development seed
fails — nothing was ever going to answer, so the job burned twelve
minutes before `timeout` killed it with exit 124 and no useful output.

Check whether the app container is still running between polls and bail
out immediately with its logs when it is not. A startup failure now
surfaces in seconds instead of the readiness probe hiding it, and the
overall budget drops from 720s to 180s of genuine waiting.
@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview URL: https://preview-ci-cypress-seed-reference-data-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

@jirhiker
jirhiker merged commit 399cd9d into staging Aug 21, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant