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

Accounting for asynchronous service removals #2228

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wk8
Copy link

@wk8 wk8 commented Jan 12, 2019

Swarmkit services' removal will soon become asynchronous (see
moby/moby#38525); that is, a service will only actually
get deleted once all of its containers are shut down.

This patch changes service tests' tearDown to wait for services to be
actually removed, so that there's no name collision with subsequent tests.

This change is fully backward compatible with the engine's current behaviour.

Couple of other misc changes: consolidated polling in a single
wait_until_truthy function, and allowed passing more flags to py.test in
the makefile test-integration targets through a new optional pytest_options
env variable.

Signed-off-by: Jean Rouge [email protected]

Swarmkit services' removal will soon become asynchronous (see
moby/moby#38525); that is, a service will only actually
get deleted once all of its containers are shut down.

This patch changes service tests' `tearDown` to wait for services to be
actually removed, so that there's no name collision with subsequent tests.

This change is fully backward compatible with the engine's current behaviour.

Couple of other misc changes: consolidated polling in a single
`wait_until_truthy` function, and allowed passing more flags to `py.test` in
the makefile test-integration targets through a new optional `pytest_options`
env variable.

Signed-off-by: Jean Rouge <[email protected]>
@@ -35,11 +35,11 @@ unit-test-py3: build-py3

.PHONY: integration-test
integration-test: build
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python py.test -v tests/integration/${file}
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python py.test -v tests/integration/${file} ${pytest_options}
Copy link
Author

Choose a reason for hiding this comment

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

@cpuguy83
Copy link
Contributor

Just to copy over what I said in moby/moby, there should be nothing to change in docker-py (or any API client). If docker-py is broken because of a proposed change in moby, then the proposed change is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants