Skip to content

Commit e786476

Browse files
authored
[DPE-5686] Fix flaky CI (#147)
1 parent 7ceb28a commit e786476

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ max-complexity = 10
136136

137137
[tool.pyright]
138138
include = ["src"]
139-
extraPaths = ["./lib"]
139+
extraPaths = ["./lib", "src"]
140140
pythonVersion = "3.10"
141141
pythonPlatform = "All"
142142
typeCheckingMode = "basic"

tests/integration/test_balancer.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ async def test_minimum_brokers_balancer_starts(self, ops_test: OpsTest):
143143
status="active",
144144
timeout=1800,
145145
idle_period=60,
146+
raise_on_error=False,
146147
)
147148

148149
assert balancer_is_running(
@@ -324,9 +325,12 @@ async def test_tls(self, ops_test: OpsTest):
324325
await ops_test.model.add_relation(TLS_NAME, f"{BALANCER_APP}:{TLS_RELATION}")
325326

326327
await ops_test.model.wait_for_idle(
327-
apps=list({APP_NAME, ZK_NAME, self.balancer_app}), idle_period=30, timeout=1800
328+
apps=list({APP_NAME, ZK_NAME, self.balancer_app}),
329+
status="active",
330+
idle_period=30,
331+
timeout=1800,
328332
)
329-
async with ops_test.fast_forward(fast_interval="20s"):
333+
async with ops_test.fast_forward(fast_interval="30s"):
330334
await asyncio.sleep(120) # ensure update-status adds broker-capacities if missed
331335

332336
# Assert that balancer is running and using certificates

tests/integration/test_password_rotation.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ async def test_build_and_deploy(ops_test: OpsTest, kafka_charm):
4040
),
4141
)
4242
await ops_test.model.block_until(lambda: len(ops_test.model.applications[ZK_NAME].units) == 3)
43-
await ops_test.model.wait_for_idle(apps=[APP_NAME, ZK_NAME], timeout=2000, idle_period=30)
43+
await ops_test.model.wait_for_idle(
44+
apps=[APP_NAME, ZK_NAME], timeout=2000, idle_period=30, raise_on_error=False
45+
)
4446

4547
assert ops_test.model.applications[APP_NAME].status == "blocked"
4648
assert ops_test.model.applications[ZK_NAME].status == "active"
@@ -49,7 +51,7 @@ async def test_build_and_deploy(ops_test: OpsTest, kafka_charm):
4951

5052
async with ops_test.fast_forward(fast_interval="60s"):
5153
await ops_test.model.wait_for_idle(
52-
apps=[APP_NAME, ZK_NAME], idle_period=30, status="active", timeout=2000
54+
apps=[APP_NAME, ZK_NAME], status="active", idle_period=30, timeout=3600
5355
)
5456

5557

tests/integration/test_tls.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,7 @@ async def test_kafka_tls_scaling(ops_test: OpsTest):
272272

273273
# Wait for model to settle
274274
await ops_test.model.wait_for_idle(
275-
apps=[APP_NAME],
276-
status="active",
277-
idle_period=40,
278-
timeout=2000,
275+
apps=[APP_NAME], status="active", idle_period=40, timeout=2000, raise_on_error=False
279276
)
280277

281278
async with ops_test.fast_forward(fast_interval="20s"):

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ lib_path = {tox_root}/lib/charms/kafka
1414
all_path = {[vars]src_path} {[vars]tests_path}
1515

1616
[testenv]
17+
basepython = python3.10
1718
allowlist_externals =
1819
/bin/bash
1920
poetry

0 commit comments

Comments
 (0)