Repository navigation
test(node): Log slow and failed Docker Compose starts in integration tests - #25278
Merged
JPeer264 merged 1 commit intoOct 14, 2026
Merged
Conversation
JPeer264
added this pull request to stack #25283
October 12, 2026 12:19
Contributor
size-limit report 📦
|
JPeer264
marked this pull request as ready for review
October 12, 2026 12:27
JPeer264
requested review from
andreiborza,
isaacs and
mydea
and removed request for
a team
October 12, 2026 12:27
JPeer264
force-pushed
the
jp/flaky-docker-compose-start
branch
from
October 12, 2026 12:34
a3d26d0 to
aa368ec
Compare
nicohrubec
approved these changes
Oct 13, 2026
| }); | ||
| const pullMs = Date.now() - pullStartedAt; | ||
| if (pull.status !== 0) { | ||
| // `up` pulls missing images too, so only report this |
Member
There was a problem hiding this comment.
as in don't kill the test yet because we get a second try when docker compose up runs? maybe this could be clarified a bit
Comment on lines
131
to
+145
| const maxAttempts = 3; | ||
| const upStartedAt = Date.now(); | ||
| let attemptStartedAt = upStartedAt; | ||
| let result = composeUp(); | ||
| for (let attempt = 1; attempt < maxAttempts && result.status !== 0; attempt++) { | ||
| // eslint-disable-next-line no-console | ||
| console.warn( | ||
| `[docker compose] up --wait attempt ${attempt} failed after ${Date.now() - attemptStartedAt}ms ` + | ||
| `(exit ${result.status}) in ${cwd}\n${output(result)}\n--- container logs ---\n${containerLogs()}`, | ||
| ); | ||
| close(); | ||
| attemptStartedAt = Date.now(); | ||
| result = composeUp(); | ||
| } | ||
| const upMs = Date.now() - upStartedAt; |
Member
There was a problem hiding this comment.
Suggested change
| const maxAttempts = 3; | |
| const upStartedAt = Date.now(); | |
| let attemptStartedAt = upStartedAt; | |
| let result = composeUp(); | |
| for (let attempt = 1; attempt < maxAttempts && result.status !== 0; attempt++) { | |
| // eslint-disable-next-line no-console | |
| console.warn( | |
| `[docker compose] up --wait attempt ${attempt} failed after ${Date.now() - attemptStartedAt}ms ` + | |
| `(exit ${result.status}) in ${cwd}\n${output(result)}\n--- container logs ---\n${containerLogs()}`, | |
| ); | |
| close(); | |
| attemptStartedAt = Date.now(); | |
| result = composeUp(); | |
| } | |
| const upMs = Date.now() - upStartedAt; | |
| const maxAttempts = 3; | |
| const upStartedAt = Date.now(); | |
| let result: ReturnType<typeof spawnSync> | undefined; | |
| for (let attempt = 1; attempt <= maxAttempts && result?.status !== 0; attempt++) { | |
| const attemptStartedAt = Date.now(); | |
| result = composeUp(); | |
| if (result.status !== 0 && attempt < maxAttempts) { | |
| // eslint-disable-next-line no-console | |
| console.warn( | |
| `[docker compose] up --wait attempt ${attempt} failed after ${Date.now() - attemptStartedAt}ms ` + | |
| `(exit ${result.status}) in ${cwd}\n${output(result)}\n--- container logs ---\n${containerLogs()}`, | |
| ); | |
| close(); | |
| } | |
| } | |
| const upMs = Date.now() - upStartedAt; |
just a suggestion, I think this is a bit nicer to read and understand because it demonstrates the flow a bit better but no strong opinions
JPeer264
removed this pull request from stack #25283
October 13, 2026 15:29
JPeer264
added this pull request to stack #25335
October 13, 2026 15:29
…tests The beforeAll hook of describeWithDockerCompose blocks the event loop with spawnSync, so when it took longer than its 120s timeout, vitest reported only "Hook timed out" and not what took long. - Pull missing images in their own step and log the pull and start times when they take longer than 60s. - Log the output and container logs of each failed `up --wait` attempt before the retry. - Give SQL Server a 60s start period before its healthcheck failures count, so a slow start does not cause a restart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/flaky-docker-compose-start
branch
from
October 13, 2026 15:36
aa368ec to
85a2cb0
Compare
51 tasks done
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.
This makes slow or failed Docker Compose starts in the Node integration tests visible:
up --waitattempt logs its output and the container logs before the retry.mssqlhealthcheck gets a 60 s start period, so a slow SQL Server start does not cause a restart.Why
The
beforeAllhook blocks the event loop withspawnSync. When it took longer than 120 s, vitest only reported "Hook timed out in 120000ms" and not what took long. This happened when the runner first had to pull the 1.5 GBmssqlimage.Known issues
Failed on CI: https://github.com/getsentry/sentry-javascript/actions/runs/38033058956/job/114158377266