Closed Mahoney closed 5 months ago
Our code is as follows:
String sshPublicKey = "valid ssh public key, this all passes locally and 90% of the time on GHA";
GitServerContainer gitRepoContainer =
new GitServerContainer(GitServerVersions.V2_43.getDockerImageName())
.withGitRepo("testRepo")
.withClasspathResourceMapping("sshd_config", "/etc/ssh/sshd_config", READ_ONLY);
gitRepoContainer.withCopyToContainer(Transferable.of(sshPublicKey), "/home/git/.ssh/authorized_keys");
gitRepoContainer.start();
// code that interacts with the container
I saw this phenomen on some GHA. Could you please paste your GHA code?
Hi @Mahoney,
I have thought about this problem. Maybe I can solve this problem if I change the waiting strategy from log checking to port checking.
Meanwhile, perhaps adding a Startup check strategy could help you with your problem.
Sorry, didn't mean to ignore this.
I haven't actually seen it fail for a while now... yes, I could look into a custom wait strategy if needed.
Our GHA is pretty simple:
name: Build branch
on:
push:
branches-ignore:
- 'master'
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
PROGRESS_NO_TRUNC: 1
permissions: write-all
jobs:
test:
runs-on: ubuntu-16-core
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
validate-wrappers: true
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
env:
DB_TYPE: LOCAL_POSTGRES
DB_CONNECTION_TIMEOUT: 20
OT_LOG_LEVEL: WARN
run: ./gradlew check
Using
0.6.0
withrockstorm/git-server:2.43
we have a flaky test on GitHub Actions.All of our tests start a new container, but it's always the first test to start a git container that fails, we can see it's just after the pull.
It has thrown both an
org.apache.sshd.common.SshException: Session is closed
and ajava.io.IOException: Broken pipe
.Relevant logs:
And the other time: