Skip to content

Commit c8824e7

Browse files
committed
Use simpler charms in tests
to avoid timeout errors simply because it takes longer with complex charms
1 parent 8da98f4 commit c8824e7

3 files changed

Lines changed: 17 additions & 25 deletions

File tree

tests/bundle/bundle.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
series: jammy
22
applications:
3-
grafana:
4-
charm: "grafana"
5-
channel: stable
6-
num_units: 1
7-
prometheus:
8-
charm: "prometheus2"
9-
channel: stable
3+
juju-qa-test:
4+
charm: "juju-qa-test"
105
num_units: 1
6+
nrpe:
7+
charm: "nrpe"
118
relations:
12-
- ["prometheus:grafana-source", "grafana:grafana-source"]
9+
- ["nrpe:general-info", "juju-qa-test:juju-info"]

tests/bundle/mini-bundle.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
series: jammy
22
applications:
3-
grafana:
4-
charm: "grafana"
5-
channel: stable
3+
juju-qa-test:
4+
charm: "juju-qa-test"
65
num_units: 1
7-
prometheus:
8-
charm: "prometheus2"
9-
channel: stable
6+
nrpe:
7+
charm: "nrpe"
108
num_units: 1
119
relations:
12-
- ["prometheus:grafana-source", "grafana:grafana-source"]
10+
- ["nrpe:general-info", "juju-qa-test:juju-info"]

tests/integration/test_model.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@ async def test_deploy_local_bundle_dir(event_loop):
4343
async with base.CleanModel() as model:
4444
await model.deploy(str(bundle_path))
4545

46-
app1 = model.applications.get('grafana')
47-
app2 = model.applications.get('prometheus')
46+
app1 = model.applications.get('juju-qa-test')
47+
app2 = model.applications.get('nrpe')
4848
with open("/tmp/output", "w") as writer:
4949
writer.write(str(bundle_path) + "\n")
5050
for (k, v) in model.applications.items():
5151
writer.write(k)
5252
assert app1 and app2
53-
await model.block_until(lambda: (len(app1.units) == 1 and
54-
len(app2.units) == 1),
55-
timeout=60 * 4)
53+
# import pdb;pdb.set_trace()
54+
await model.wait_for_idle(['juju-qa-test', 'nrpe'], wait_for_at_least_units=1)
5655

5756

5857
@base.bootstrapped
@@ -64,12 +63,10 @@ async def test_deploy_local_bundle_file(event_loop):
6463
async with base.CleanModel() as model:
6564
await model.deploy(str(mini_bundle_file_path))
6665

67-
app1 = model.applications.get('grafana')
68-
app2 = model.applications.get('prometheus')
66+
app1 = model.applications.get('juju-qa-test')
67+
app2 = model.applications.get('nrpe')
6968
assert app1 and app2
70-
await model.block_until(lambda: (len(app1.units) == 1 and
71-
len(app2.units) == 1),
72-
timeout=60 * 4)
69+
await model.wait_for_idle(['juju-qa-test', 'nrpe'], wait_for_at_least_units=1)
7370

7471

7572
@base.bootstrapped

0 commit comments

Comments
 (0)