Skip to content

Commit e71b6a2

Browse files
committed
fix(test): increase multi-role replica polling timeout to 90s
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent a8fe490 commit e71b6a2

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ This warning means:
2929
You have two valid options:
3030

3131
1. **You do not want External Apps**
32-
- Disable AppAPI in **Apps Tools AppAPI**, or with:
32+
- Disable AppAPI in **Apps --> Tools --> AppAPI**, or with:
3333
- `occ app:disable app_api`
3434
- The warning will disappear.
3535

3636
2. **You want to install External Apps**
37-
- Open **Settings Administration AppAPI**
37+
- Open **Settings --> Administration --> AppAPI**
3838
- Register a Deploy Daemon and set it as the default
3939
- Use **Check connection** and **Test deploy** to verify the setup
4040

tests/test_occ_commands_k8s.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -632,27 +632,27 @@ def test_k8s_multi_deploy():
632632
print("OK")
633633

634634

635-
def _wait_multi_role_replicas(expected, label="app.kubernetes.io/component=exapp", timeout_sec=30):
635+
def _wait_multi_role_replicas(expected, label="app.kubernetes.io/component=exapp", timeout_sec=90):
636636
"""Poll until all multi-role deployments reach the expected replica count."""
637-
for _ in range(timeout_sec // 2):
637+
last_state = ""
638+
for attempt in range(timeout_sec // 3):
638639
deploy_json = kubectl_output(f"get deploy -l {label} -o json", check=False)
639640
data = json.loads(deploy_json)
640641
items = data.get("items", [])
641642
if len(items) >= 2 and all(
642643
item["spec"].get("replicas", -1) == expected for item in items
643644
):
644645
return items
645-
time.sleep(2)
646+
last_state = ", ".join(
647+
f"{item['metadata']['name']}={item['spec'].get('replicas', '?')}"
648+
for item in items
649+
)
650+
time.sleep(3)
646651
# Final check with assertion
647-
deploy_json = kubectl_output(f"get deploy -l {label} -o json", check=False)
648-
data = json.loads(deploy_json)
649-
items = data.get("items", [])
650-
assert len(items) >= 2, f"Expected 2+ deployments, got {len(items)}"
651-
for item in items:
652-
replicas = item["spec"].get("replicas", -1)
653-
name = item["metadata"]["name"]
654-
assert replicas == expected, f"Expected {expected} replicas for {name}, got {replicas}"
655-
return items
652+
assert False, (
653+
f"Timed out waiting for replicas={expected} after {timeout_sec}s. "
654+
f"Last state: {last_state}"
655+
)
656656

657657

658658
def test_k8s_multi_enable_disable():
@@ -663,7 +663,7 @@ def test_k8s_multi_enable_disable():
663663
r = occ("app_api:app:disable app-skeleton-python", check=False, timeout=120)
664664
assert r.returncode == 0, f"Disable failed: {r.stdout.decode()}"
665665

666-
# Verify all deployments scaled to 0 (poll to avoid race)
666+
# Verify all deployments scaled to 0 (poll to avoid race with HaRP-to-K8s propagation)
667667
_wait_multi_role_replicas(0)
668668

669669
# Verify AppAPI shows disabled

0 commit comments

Comments
 (0)