Skip to content

Commit 5d59db1

Browse files
committed
Add some wait stops in test case to avoid races
1 parent 0c3409d commit 5d59db1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/integration/test_charmhub.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from .. import base
44
from juju.errors import JujuAPIError, JujuError
5+
from juju import jasyncio
56

67

78
@base.bootstrapped
@@ -81,14 +82,18 @@ async def test_subordinate_charm_zero_units(event_loop):
8182

8283
# rsyslog-forwarder-ha is a subordinate charm
8384
app = await model.deploy('rsyslog-forwarder-ha')
85+
await jasyncio.sleep(5)
86+
8487
assert len(app.units) == 0
8588
await app.destroy()
89+
await jasyncio.sleep(5)
8690

8791
# note that it'll error if the user tries to use num_units
8892
with pytest.raises(JujuError):
8993
await model.deploy('rsyslog-forwarder-ha', num_units=175)
9094

9195
# (full disclosure: it'll quitely switch to 0 if user enters
92-
# num_units=1)
96+
# num_units=1, instead of erroring)
9397
app2 = await model.deploy('rsyslog-forwarder-ha', num_units=1)
98+
await jasyncio.sleep(5)
9499
assert len(app2.units) == 0

0 commit comments

Comments
 (0)