test: fix flaky multi-node Test crush rules step (pool migration race)#741
Merged
Conversation
The "Test crush rules" step in the multi-node CI job races against mgr pool creation and crush-rule migration. After the failure-domain auto-switch flips the default crush rule from osd (id 1) to host (id 2), the mgr-created .mgr pool may not yet exist or its rule migration may still be in flight when the assertion runs. `ceph osd pool ls detail | grep -F "crush_rule 2"` then exits 1 because either no pools are listed, or the only listed pool still has crush_rule 1. Add a wait_for_pool_crush_rule helper to actionutils.sh that polls `ceph osd pool ls detail` until a pool reaches the expected rule (default 30 tries * 2s = 60s budget), and use it from the workflow step. The crush rule existence check is unchanged. Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com> Assisted-by: Claude Opus 4.7 <noreply@anthropic.com>
johnramsden
added a commit
to johnramsden/microceph
that referenced
this pull request
May 29, 2026
Replaces all 22 bash CI test jobs with Robot Framework 7.x suites that produce structured HTML/XML reports, support selective suite execution, and make failures easier to diagnose with inline keyword-level output. Structure: - tests/robot/resources/microceph_harness.resource — ~110 shared keywords (VM lifecycle, snap install, cluster bootstrap, OSD/RGW/NFS helpers) - tests/robot/resources/streaming_process.py — real-time output for long-running processes (DSL, cephadm-adopt, wiping) - 23 suite directories under tests/robot/, one per CI job: single-system-tests, multi-node-tests, availability-zone-tests, multi-node-tests-with-custom-microceph-ip, test-sequential-mon-host-refresh, test-maintenance-modes, loop-file-tests, wal-db-tests, upgrade-reef-tests, cluster-tests, rbd-replication-test, cephfs-replication-test, nfs-test, nfs-multinode-test, messenger-v2-tests, wiping-test, cephadm-adopt-test, dsl-functional-tests (6 parallel jobs), api-tests, static-checks, unit-tests - robot.py / tox.ini — CLI wrapper and tox integration for local runs - tests/scripts/: actionutils.sh idempotency fix, adoptutils.sh upstream fixes, test_dsl_functest.sh timeout hardening Migration style: - Inline reimplementation: bash logic rewritten as Robot/harness keywords (the majority — checked line-by-line for 1:1 parity) - Direct bash execution: very long suites (DSL x6, cephadm-adopt, wiping, api-disk) run the original .sh unchanged via Run Streaming Process - All flakiness fixes from upstream (canonical#737, canonical#741) incorporated; additional retry loops and polling guards added throughout Assisted-by: claude-code:claude-sonnet-4-6 Assisted-by: claude-code:claude-opus-4-7 Assisted-by: claude-code:claude-opus-4-8 Signed-off-by: John Ramsden <john.ramsden@canonical.com>
johnramsden
added a commit
to johnramsden/microceph
that referenced
this pull request
May 29, 2026
Replaces all 22 bash CI test jobs with Robot Framework 7.x suites that produce structured HTML/XML reports, support selective suite execution, and make failures easier to diagnose with inline keyword-level output. Structure: - tests/robot/resources/microceph_harness.resource — ~110 shared keywords (VM lifecycle, snap install, cluster bootstrap, OSD/RGW/NFS helpers) - tests/robot/resources/streaming_process.py — real-time output for long-running processes (DSL, cephadm-adopt, wiping) - 23 suite directories under tests/robot/, one per CI job: single-system-tests, multi-node-tests, availability-zone-tests, multi-node-tests-with-custom-microceph-ip, test-sequential-mon-host-refresh, test-maintenance-modes, loop-file-tests, wal-db-tests, upgrade-reef-tests, cluster-tests, rbd-replication-test, cephfs-replication-test, nfs-test, nfs-multinode-test, messenger-v2-tests, wiping-test, cephadm-adopt-test, dsl-functional-tests (6 parallel jobs), api-tests, static-checks, unit-tests - robot.py / tox.ini — CLI wrapper and tox integration for local runs - tests/scripts/: actionutils.sh idempotency fix, adoptutils.sh upstream fixes, test_dsl_functest.sh timeout hardening Migration style: - Inline reimplementation: bash logic rewritten as Robot/harness keywords (the majority — checked line-by-line for 1:1 parity) - Direct bash execution: very long suites (DSL x6, cephadm-adopt, wiping, api-disk) run the original .sh unchanged via Run Streaming Process - All flakiness fixes from upstream (canonical#737, canonical#741) incorporated; additional retry loops and polling guards added throughout Assisted-by: claude-code:claude-sonnet-4-6 Assisted-by: claude-code:claude-opus-4-7 Assisted-by: claude-code:claude-opus-4-8 Signed-off-by: John Ramsden <john.ramsden@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test crush rulesstep in the multi-node CI job races against.mgrpool creation / crush-rule migration after the failure-domain auto-switch flips the default rule frommicroceph_auto_osd(id 1) tomicroceph_auto_host(id 2).ceph osd pool ls detail | grep -F "crush_rule 2"exits 1 when either no pools are listed yet, or the only pool still carriescrush_rule 1.wait_for_pool_crush_rulehelper (30 tries × 2s) and call it from the workflow step. Themicroceph_auto_hostrule existence check is unchanged.Why this lands now
Observed recent multi-node failures across branches all bottom out on the same step:
feat/orchPlusPR Enhance MicroCeph orchestrator support #721 — run 26499172061, stepTest crush rules, stderr showsosd pool ls detailreturned nocrush_rule 2. Cluster state preceding the assertion:pools: 0 pools, 0 pgs.megademo-robotruns 26424267655 and 26418196210 — robot-translated form of the same assertion fails withSTDOUT: : 1 != 0(grep matched 0 lines).The mgr daemon creates the
.mgrpool asynchronously; tests should not assume it exists at any specific tick after the rule switch.Test plan
Test crush rulesstep logsFound pool with crush_rule 2🤖 Generated with Claude Code