Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPE-5686] Fix flaky CI #147

Merged
merged 10 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ max-complexity = 10

[tool.pyright]
include = ["src"]
extraPaths = ["./lib"]
extraPaths = ["./lib", "src"]
pythonVersion = "3.10"
pythonPlatform = "All"
typeCheckingMode = "basic"
Expand Down
8 changes: 6 additions & 2 deletions tests/integration/test_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ async def test_minimum_brokers_balancer_starts(self, ops_test: OpsTest):
status="active",
timeout=1800,
idle_period=60,
raise_on_error=False,
)

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

await ops_test.model.wait_for_idle(
apps=list({APP_NAME, ZK_NAME, self.balancer_app}), idle_period=30, timeout=1800
apps=list({APP_NAME, ZK_NAME, self.balancer_app}),
status="active",
idle_period=30,
timeout=1800,
)
async with ops_test.fast_forward(fast_interval="20s"):
async with ops_test.fast_forward(fast_interval="30s"):
await asyncio.sleep(120) # ensure update-status adds broker-capacities if missed

# Assert that balancer is running and using certificates
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/test_password_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ async def test_build_and_deploy(ops_test: OpsTest, kafka_charm):
),
)
await ops_test.model.block_until(lambda: len(ops_test.model.applications[ZK_NAME].units) == 3)
await ops_test.model.wait_for_idle(apps=[APP_NAME, ZK_NAME], timeout=2000, idle_period=30)
await ops_test.model.wait_for_idle(
apps=[APP_NAME, ZK_NAME], timeout=2000, idle_period=30, raise_on_error=False
)

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

async with ops_test.fast_forward(fast_interval="60s"):
await ops_test.model.wait_for_idle(
apps=[APP_NAME, ZK_NAME], idle_period=30, status="active", timeout=2000
apps=[APP_NAME, ZK_NAME], status="active", idle_period=30, timeout=3600
)


Expand Down
5 changes: 1 addition & 4 deletions tests/integration/test_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,7 @@ async def test_kafka_tls_scaling(ops_test: OpsTest):

# Wait for model to settle
await ops_test.model.wait_for_idle(
apps=[APP_NAME],
status="active",
idle_period=40,
timeout=2000,
apps=[APP_NAME], status="active", idle_period=40, timeout=2000, raise_on_error=False
)

async with ops_test.fast_forward(fast_interval="20s"):
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ lib_path = {tox_root}/lib/charms/kafka
all_path = {[vars]src_path} {[vars]tests_path}

[testenv]
basepython = python3.10
allowlist_externals =
/bin/bash
poetry
Expand Down
Loading