Skip to content

test(cluster): fix barman-plugin-migration test assertions#938

Closed
aqeelat wants to merge 29 commits into
cloudnative-pg:feat/barman-plugin-supportfrom
aqeelat:fix/barman-plugin-migration-tests
Closed

test(cluster): fix barman-plugin-migration test assertions#938
aqeelat wants to merge 29 commits into
cloudnative-pg:feat/barman-plugin-supportfrom
aqeelat:fix/barman-plugin-migration-tests

Conversation

@aqeelat

@aqeelat aqeelat commented Jul 2, 2026

Copy link
Copy Markdown

Fixes the consistently-failing barman-plugin-migration chainsaw test. The migration itself works correctly (verified against the plugin migration docs and operator source); the failures are in assertions of transient states, plus one secret-name typo.

1. Migration "Upgrading cluster" phase (step 4)UpgradingInstance event
status.phase is set for only a fraction of a second — the operator's own e2e tests model rollouts as PhaseUpgrade → PhaseWaitingForInstancesToBeActive (tests/e2e/probes_test.go), and helm upgrade --wait doesn't gate CNPG CRDs (returns in ~0.5s), so polling always missed it. Replaced with a polling assert on the persistent UpgradingInstance Event.

2. Backup "running" phase (step 5)Starting event
The backup completes in ~10s, faster than chainsaw polls. Replaced with a polling assert on the backup Starting Event (backup_controller.go:337).

3. PITR secret name (step 8)
Referenced recovery-backup-pitr-superuser (release name) instead of recovery-backup-pitr-cluster-superuser (cluster name) → CreateContainerConfigError. Fixed.

Verification: passes end-to-end in isolated fork CI (identical test( cluster ) workflow), including PITR recovery — run 28597616579.

Supplements #924.

tuunit and others added 29 commits June 24, 2026 18:16
…g#776)

Signed-off-by: Nolan Gilley <nkgilley@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Signed-off-by: Itay Grudev <itay+github.com@grudev.com>
Co-authored-by: Nolan Gilley <nkgilley@gmail.com>
Co-authored-by: Itay Grudev <itay+github.com@grudev.com>
…e-pg#927)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…#926)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
…uster

Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
…only

Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
…ions

Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
Signed-off-by: Itay Grudev <itay@verito.digital>
The barman-plugin-migration chainsaw test fails consistently in CI. The
migration itself works correctly (verified against operator source and the
plugin migration docs); the failures are in test assertions of transient
states, plus one secret-name typo.

- Migration 'Upgrading cluster' phase (step 4): status.phase is set for only
  a fraction of a second (the operator models rollouts as PhaseUpgrade ->
  PhaseWaitingForInstancesToBeActive, see tests/e2e/probes_test.go), and
  helm --wait does not gate CNPG CRDs, so polling always missed it. Replaced
  with a polling assert on the persistent UpgradingInstance Event.

- Backup 'running' phase (step 5): the backup completes in ~10s, faster than
  polling. Replaced with a polling assert on the persistent backup 'Starting'
  Event (backup_controller.go:337).

- PITR secret name (step 8): referenced recovery-backup-pitr-superuser
  (release name) instead of recovery-backup-pitr-cluster-superuser (cluster
  name), causing CreateContainerConfigError. Fixed.

Verified end-to-end in isolated fork CI (identical test( cluster )
workflow), including PITR recovery.

Signed-off-by: Abdullah Alaqel <abdullah.t.aqeel@gmail.com>
Signed-off-by: Abdullah Alaqeel <abdullah.t.aqeel@gmail.com>
@aqeelat aqeelat requested a review from itay-grudev as a code owner July 2, 2026 14:46
@aqeelat aqeelat requested a review from phisco as a code owner July 2, 2026 14:46
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 2, 2026
@itay-grudev itay-grudev force-pushed the feat/barman-plugin-support branch from 20e887c to 0ac2b24 Compare July 3, 2026 07:45
@itay-grudev

Copy link
Copy Markdown
Collaborator

merged.

@itay-grudev itay-grudev closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants