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-6247] fix: flaky integrations tests #292

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions src/managers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
partition.metric.sample.store.topic=__KafkaCruiseControlPartitionMetricSamples
broker.metric.sample.store.topic=__KafkaCruiseControlModelTrainingSamples
max.active.user.tasks=10
default.api.timeout.ms=20000
request.timeout.ms=10000
"""
# Divided periods by 10
CRUISE_CONTROL_TESTING_OPTIONS = """
Expand All @@ -72,6 +74,8 @@
min.samples.per.partition.metrics.window=1
num.partition.metrics.windows=3
num.broker.metrics.windows=10
default.api.timeout.ms=10000
request.timeout.ms=5000
"""
SERVER_PROPERTIES_BLACKLIST = [
"profile",
Expand Down
13 changes: 7 additions & 6 deletions tests/integration/test_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ class TestBalancer:

@pytest.mark.abort_on_fail
async def test_build_and_deploy(self, ops_test: OpsTest, kafka_charm):
await ops_test.model.add_machine(series="jammy")
machine_ids = await ops_test.model.get_machines()

await asyncio.gather(
ops_test.model.deploy(
kafka_charm,
application_name=APP_NAME,
num_units=1,
series="jammy",
to=machine_ids[0],
config={
"roles": "broker,balancer" if self.balancer_app == APP_NAME else "broker",
"profile": "testing",
Expand Down Expand Up @@ -118,7 +115,10 @@ async def test_relate_not_enough_brokers(self, ops_test: OpsTest):
)

await ops_test.model.wait_for_idle(
apps=list({APP_NAME, ZK_NAME, self.balancer_app}), idle_period=30
apps=list({APP_NAME, ZK_NAME, self.balancer_app}),
idle_period=30,
timeout=1200,
check_freq=30,
)

async with ops_test.fast_forward(fast_interval="20s"):
Expand All @@ -140,7 +140,8 @@ async def test_minimum_brokers_balancer_starts(self, ops_test: OpsTest):
await ops_test.model.wait_for_idle(
apps=list({APP_NAME, ZK_NAME, self.balancer_app, PRODUCER_APP}),
status="active",
timeout=1800,
timeout=3600,
check_freq=30,
idle_period=60,
raise_on_error=False,
)
Expand Down Expand Up @@ -327,7 +328,7 @@ async def test_tls(self, ops_test: OpsTest):
apps=list({APP_NAME, ZK_NAME, self.balancer_app}),
status="active",
idle_period=30,
timeout=1800,
timeout=3600,
)
async with ops_test.fast_forward(fast_interval="30s"):
await asyncio.sleep(120) # ensure update-status adds broker-capacities if missed
Expand Down
Loading