Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add status check to wait strategies #944

Merged

Conversation

frozenbonito
Copy link
Contributor

What does this PR do?

This PR adds container status check to wait strategies while polling.

Why is it important?

Some strategies assume the container is running.
However, a container may terminate due to an unexpected error, etc. Even in this case, testcontainers-go will keep waiting until the timeout.

This PR enables fail-fast when a container stops.

Related issues

@frozenbonito frozenbonito requested a review from a team as a code owner March 21, 2023 05:02
@netlify
Copy link

netlify bot commented Mar 21, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 1584e32
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/641b118eda94a30008e24e79
😎 Deploy Preview https://deploy-preview-944--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Collaborator

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frozenbonito it LGTM, thanks for your contribution!

I added a few comments, minors, but wanted to check with you first before approving the PR.

wait/log.go Show resolved Hide resolved
wait/wait.go Outdated Show resolved Hide resolved
wait/http_test.go Outdated Show resolved Hide resolved
@mdelapenya mdelapenya self-assigned this Mar 21, 2023
@mdelapenya mdelapenya added the enhancement New feature or request label Mar 21, 2023
@frozenbonito frozenbonito force-pushed the fails-wait-when-container-stops branch 2 times, most recently from 4900223 to 6c456ee Compare March 21, 2023 14:16
@frozenbonito frozenbonito force-pushed the fails-wait-when-container-stops branch from 6c456ee to 1584e32 Compare March 22, 2023 14:32
@sonarcloud
Copy link

sonarcloud bot commented Mar 22, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
59.6% 59.6% Duplication

Copy link
Collaborator

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your patience during the review

We really appreciate your love for OSS and Testcontainers for Go!

@mdelapenya mdelapenya merged commit bb98792 into testcontainers:main Mar 22, 2023
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Fails the wait when the container stops
2 participants