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

[JUJU-858] Add quality of life feature ensure application removal at return #665

Merged
merged 1 commit into from Apr 19, 2022

Conversation

cderici
Copy link
Member

@cderici cderici commented Apr 6, 2022

Description

This is to make life easier by allowing the following pattern:

    await ops_test.model.applications[related_app.name].remove()
    # Block until it is really gone. Added after an itest failed when tried to redeploy:
    # juju.errors.JujuError: ['cannot add application "related-app": application already exists']
    await ops_test.model.block_until(lambda: related_app.name not in ops_test.model.applications)

to be written as:

    await ops_test.model.remove_application(related_app.name, block_until_done=True)

Fixes #656

QA Steps

tox -e integration -- tests/integration/test_application.py::test_app_remove_wait_flag

Notes & Discussion

Another option would be to do await ops_test.model.applications[related_app.name].remove(block_until_done=True), however, then it gets weird to ask the app.model to block_until the app.name is no longer in model.applications while the app object is being torn down.

Copy link
Contributor

@juanmanuel-tirado juanmanuel-tirado left a comment

Choose a reason for hiding this comment

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

LG2M

@cderici
Copy link
Member Author

cderici commented Apr 19, 2022

$$merge$$

@jujubot jujubot merged commit 7d2a423 into juju:master Apr 19, 2022
@cderici cderici deleted the wait-for-app-remove branch April 19, 2022 15:52
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.

Means to wait for an app to really be removed
3 participants