Repository navigation
Conversation
Collaborator
|
Thanks for this! Let's keep
Could you remove |
stop() already kills by default, a killed container still looks started until testcontainers#1545 and testcontainers#1541 land, and no other Testcontainers implementation has kill().
Author
done @cristianrgreco |
This branch has not been deployed
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.
Summary
Started containers get
pause()andunpause(), so tests for reconnects, failover and timeouts can freeze a container without going through Dockerode.ContainerClientgets the matching two methods, andStartedGenericContainercalls them.AbstractStartedContainerforwards both, so module containers pick them up with no changes. The docs get a short "Pausing a container" section.I dropped
kill()after review.stop()already kills by default, a killed container would still look started until #1545 and #1541 land, and no other Testcontainers implementation has it.Verification
generic-container-pause.test.tspauses the container and checks that inspect reportsState.Pausedas true. It then unpauses it and checks thatState.Pausedis false again and the container serves HTTP. The test fails before the change withcontainer.pause is not a functionand passes after it. The existing restart tests still pass, andnpm run format,npm run lint,npm run knipandnpm run check-compilesare clean.Not breaking
The change only adds methods. Code that implements
StartedTestContainerorContainerClientby hand, instead of extendingAbstractStartedContainer, would need the two new methods. Every module in this repo extendsAbstractStartedContainer, so none of them change.Closes #1549