Last active
July 10, 2023 14:13
-
-
Save DnPlas/7090b044f2d52d9666bdac284a73a776 to your computer and use it in GitHub Desktop.
`wait_for_idle` not working
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
| pytest | |
| pytest-operator | |
| juju==2.9.42.4 |
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
| from pytest_operator.plugin import OpsTest | |
| async def test_deploy_pod_spec_charms(ops_test: OpsTest): | |
| # Deploy a sidecar charm | |
| # Allow it some time to be active before the podspec charms | |
| # to be able to reproduce the issue | |
| await ops_test.model.deploy("training-operator", channel="1.6/stable", trust=True) | |
| import time; time.sleep(60) | |
| # Deploy all pods pec charms | |
| await ops_test.model.deploy("minio", channel="ckf-1.7/stable") | |
| await ops_test.model.deploy("argo-server", channel="3.3/stable") | |
| #await ops_test.model.deploy("argo-controller", channel="3.3/stable") | |
| # Relate minio and argo-controller | |
| # await ops_test.model.add_relation("minio", "argo-controller") | |
| # Wait for active | |
| # Use a small-ish timeout to be able to reproduce the issue | |
| await ops_test.model.wait_for_idle(status="active", raise_on_blocked=False, raise_on_error=True, timeout=100) |
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
| from pytest_operator.plugin import OpsTest | |
| async def test_deploy_pod_spec_charms(ops_test: OpsTest): | |
| # Deploy all pods pec charms | |
| await ops_test.model.deploy("minio", channel="ckf-1.7/stable") | |
| await ops_test.model.deploy("argo-server", channel="3.3/stable") | |
| await ops_test.model.deploy("argo-controller", channel="3.3/stable") | |
| # Relate minio and argo-controller | |
| await ops_test.model.add_relation("minio", "argo-controller") | |
| # Wait for active | |
| await ops_test.model.wait_for_idle(status="active", raise_on_blocked=False, raise_on_error=True, timeout=300) |
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
| [tox] | |
| skipsdist = True | |
| skip_missing_interpreters = True | |
| [testenv:pod-spec-only] | |
| commands = pytest -vv --tb=native -s {posargs} test_pod_spec_only.py | |
| deps = | |
| -r requirements.txt | |
| [testenv:combined] | |
| commands = pytest -vv --tb=native -s {posargs} test_pod_spec_and_sidecar.py | |
| deps = | |
| -r requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment