test(db): report why PostgreSQL refused to start before tearing it down
Independent Staging Quality Gate / validate (push) Failing after 16m47s
Independent Staging Quality Gate / publish (push) Has been cancelled

The fixture removes the container as soon as startup fails, so every CI
failure reduced to one line: the container is unhealthy. The server's own
account of the refusal is deleted with it, which leaves a reproducible
staging-gate failure undiagnosable from the log alone.

Print the container log before the teardown runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-18 00:29:06 +08:00
parent f6715ee4bf
commit c03725ef16
@@ -115,6 +115,16 @@ export function startPostgresFixture(): PostgresFixture {
);
} catch (error) {
try {
try {
// The teardown below deletes the only account of why the server refused to start.
execFileSync(
"docker",
[...composeArguments, "logs", "--no-color", "--tail", "80", "postgres"],
{ env: environment, stdio: "inherit" },
);
} catch {
// Preserve the original startup failure.
}
try {
execFileSync(
"docker",