Skip to content

Instantly share code, notes, and snippets.

@DnPlas
Last active July 10, 2023 14:13
Show Gist options
  • Select an option

  • Save DnPlas/7090b044f2d52d9666bdac284a73a776 to your computer and use it in GitHub Desktop.

Select an option

Save DnPlas/7090b044f2d52d9666bdac284a73a776 to your computer and use it in GitHub Desktop.
`wait_for_idle` not working
pytest
pytest-operator
juju==2.9.42.4
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)
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)
[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