ci(cypress): stop waiting on an API container that already died - #351
Merged
Conversation
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.
Preview DeploymentPreview URL: https://preview-ci-cypress-seed-reference-data-auejgdbofq-uc.a.run.app Note: This preview uses the staging API endpoints. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Cypress job's readiness probe polled
http://localhost:8000/docsbehind a flattimeout 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-pagesbefore it.This checks whether the app container is still running between polls and bails out immediately with
docker compose logs appwhen 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_prereqsskipped loadingcore/lexicon.jsonbecause a migration had inserted one lexicon term, so the startup seed died on an emptyorganizationcategory. 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