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

Fix fixed host port test #1355

Merged
merged 7 commits into from Aug 25, 2019
Merged

Fix fixed host port test #1355

merged 7 commits into from Aug 25, 2019

Conversation

glebsts
Copy link
Contributor

@glebsts glebsts commented Apr 2, 2019

Child of this slack thread

Before: FixedHostPortContainerTest basically just started redis two times without any assertions. Test used redis container and had some cryptic commented-out assertion flow, so nothing was actually tested except for "container starts", in theory throwing undetermined IOException in case of any failure.

Now: test starts container with simple open-source http echo server image [1] [2], validates that port ia accessible, stops, takes "free to use host port" and starts container again with fixed host port, validates that port is accessible.

Added as much javadoc and assertion descriptions as I could. Hopefully codestyle is ok, or I will fix it based on any report provided.
Any comments are much appreciated.
As far as I can see, since my last PR changelog is not used anymore, so guess I don't need to add any notes.

@glebsts
Copy link
Contributor Author

glebsts commented Apr 2, 2019

crap, you are not using assertj in testCompile. People are crying :)
I will update to... hamcrest?

…in response getting now fails test directly with io exc
…to alpine, also copied some routines from generic container tests
// assertEquals("The bucket content was successfully set", "foo", redisson.getBucket("test").get());
// assertEquals("The container returns the fixed port from getMappedPort(...)", freePort, redis.getMappedPort(REDIS_PORT));
final Integer unusedHostPort;
String content;
Copy link
Member

Choose a reason for hiding this comment

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

this can be try-scoped

@stale
Copy link

stale bot commented Jul 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@stale stale bot added the stale label Jul 2, 2019
@stale
Copy link

stale bot commented Jul 16, 2019

This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case.

@stale stale bot closed this Jul 16, 2019
@rnorth
Copy link
Member

rnorth commented Aug 6, 2019

Hmm, I don't think we should have let this get stale - reopening. Sorry @glebsts!

@rnorth rnorth reopened this Aug 6, 2019
@stale stale bot removed the stale label Aug 6, 2019
Copy link
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you @glebsts! Sorry for such a long review time 😊

Will merge once CI is green

@bsideup bsideup self-assigned this Aug 25, 2019
@bsideup bsideup added this to the next milestone Aug 25, 2019
Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

Thanks also from me, @glebsts. Build is green so I'll merge.

@rnorth rnorth merged commit a4b7041 into testcontainers:master Aug 25, 2019
@glebsts glebsts deleted the fix-fixed-port-test branch September 13, 2021 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants