Uh oh!
There was an error while loading. Please reload this page.
FIX: fail the SQL Server readiness check when the container never starts - #722
Draft
Gaurav Sharma (bewithgaurav) wants to merge 1 commit into
Draft
FIX: fail the SQL Server readiness check when the container never starts#722Gaurav Sharma (bewithgaurav) wants to merge 1 commit into
Gaurav Sharma (bewithgaurav) wants to merge 1 commit into
Conversation
the macOS and code-coverage legs poll SQL Server in a loop whose exit status is the final sleep, so the step reported success even when every probe failed. a dead container then surfaced as 30+ minutes of pytest errors instead of an infra failure. both loops now track readiness in a flag, re-probe once after the loop, and exit 1 with container logs when SQL never came up. the six linux legs end their step with CREATE DATABASE, whose exit status already fails them, so they are left alone. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| # one last probe, in case it came up during the final sleep | ||
| docker exec sqlserver \ | ||
| /opt/mssql-tools18/bin/sqlcmd \ | ||
| -S localhost \ |
| # one last probe, in case it came up during the final sleep | ||
| docker exec sqlserver \ | ||
| /opt/mssql-tools18/bin/sqlcmd \ | ||
| -S localhost \ |
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 freeto 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.
Work Item / Issue Reference
Summary
the macOS and code-coverage legs poll SQL Server for readiness in a loop whose exit status is the final
sleep 2, so the step reports success even when every probe failed.build 166760 hit this. the container died on startup, all 30 probes logged
Error response from daemon: container ... is not running, the step still went green, and pytest then ran for 32.6 minutes against a database that did not exist, erroring on every db-backed test from the 1% mark while the non-db tests passed. the job was killed at the 60 minute default timeout. a dead container should fail in about a minute with a clear message, not surface as half an hour of test errors.both loops now track readiness in a flag, re-probe once after the loop in case SQL came up during the final sleep, and exit 1 with
docker logs --tail 200when it never became ready.the six linux legs use the same loop shape but end the step with
CREATE DATABASE TestDB, so a dead container already fails them through that command's exit status. left alone.verified against real containers locally: a dead container exits 1 where the old loop exits 0, a healthy container is unaffected, and a container that only becomes reachable after the loop is rescued by the re-probe. healthy macOS runs use 3 to 6 of the 30 attempts, so the gate keeps roughly 5x headroom.