Repository navigation
ci: wait for the ssh test containers to accept connections before testing - #2050
Merged
Merged
Conversation
…ting The linuxserver openssh-server image downloads its tunnel mod and generates host keys before sshd listens, so the fixed `sleep 5` let the mongo SSH integration tests hit a published port with nothing behind it (ECONNRESET). An ssh-keyscan healthcheck plus `docker compose up --wait` makes the job wait until sshd answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Coverage Impact This PR will not change total coverage. 🚦 See full report on Qlty Cloud »🛟 Help
|
matthv
approved these changes
Oct 29, 2026
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.

Problem
Linting & Testing (datasource-mongo)fails intermittently on main (run 40909579341, attempt 1): the 3 tests intest/index.ssh.integration.test.tsfail withread ECONNRESETon127.0.0.1:2224, then pass on re-run.The
linuxserver/openssh-servercontainer downloads itsDOCKER_MODStunnel mod from ghcr and generates host keys before sshd listens. CI only didup -d; sleep 5; with a warm dependency cache the SSH tests started 38 s after the container, while Docker already published the port with nothing listening behind it.Fix
ssh-keyscanhealthcheck on thessh-serverservice ofdatasource-mongoanddatasource-sql(same image, same mod): it checks sshd answers with its banner, not just that the port is open.docker compose up -d --wait --wait-timeout 180instead ofsleep 5; services without a healthcheck are waited on until running.Verified locally
ssh-keyscanexits 0 when sshd listens and 1 on a closed port.up --waitsucceeds with thedatasource-dynamodbcompose too;datasource-sqlcompose config validates.🤖 Generated with Claude Code
Note
Add SSH container healthchecks and wait for readiness in CI
The CI matrix job previously slept a fixed 5 seconds after starting Compose services. It now waits for containers to reach a healthy state, timing out after 180 seconds.
ssh-keyscanevery 2 seconds, with a 5-second timeout and 60 retries.Macroscope summarized e2d6b05.