Skip to content

test(async-replication): cover the events handler (7/8) - #283

Draft
marceloneppel wants to merge 1 commit into
async-replication-6-manager-testsfrom
async-replication-7-events-tests
Draft

test(async-replication): cover the events handler (7/8)#283
marceloneppel wants to merge 1 commit into
async-replication-6-manager-testsfrom
async-replication-7-events-tests

Conversation

@marceloneppel

@marceloneppel marceloneppel commented Sep 4, 2026

Copy link
Copy Markdown
Member

Issue

Covers the events handler ported in 3/8 and 4/8, driving real framework events so the guards, defers and substrate branches stay in the path.

Solution

  • create-replication: already-set-up guard, success path (counter + relation name + status), stale-counter clearing before the guard (DPE-10203), mirrored-counter kept, consumer-side rejection;
  • promote_to_primary: no-primary failure, read-only standby promotion with the per-substrate status message, stale-counter clearing;
  • relation joined/created: unit-address publication and counter propagation;
  • relation changed: late-joiner early exit per substrate, leader stop + defer until all units stopped, VM relation stop-marker;
  • relation broken: standby vs primary counter handling, ModelError-resilient standby check, departing-unit early exit;
  • secret_changed consumer credential sync, set_app_status messages, handle_read_only_mode, and the _same_secret_id helper.

Known coverage gaps against the charm originals (flagged by the pre-merge faithfulness review, follow-up candidates): the K8s standby-pgdata-cleared once-only gating, the force-promotion reachability failure path, the non-leader _wait_for_standby_leader paths (isolated restart / defer), _configure_primary_cluster's primary-side branches, and the offer-side secret_changed branch — the latter three are additionally exercised by the adoption PRs' adapted charm tests.

@marceloneppel
marceloneppel force-pushed the async-replication-6-manager-tests branch from ed5e75b to 0ae0f70 Compare September 4, 2026 23:07
@marceloneppel
marceloneppel force-pushed the async-replication-7-events-tests branch from 932ebc5 to d2402a6 Compare September 4, 2026 23:08
@marceloneppel
marceloneppel force-pushed the async-replication-6-manager-tests branch from 0ae0f70 to 87ab9ba Compare September 4, 2026 23:23
@marceloneppel
marceloneppel force-pushed the async-replication-7-events-tests branch from d2402a6 to d68d8f7 Compare September 4, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant