Skip to content

Fix stale cluster_ready restart test - #70779

Merged
dwoz merged 2 commits into
saltstack:3008.xfrom
dwoz:fix/cluster-ready-restart-test
Nov 12, 2026
Merged

dwoz merged 2 commits into
saltstack:3008.xfrom
dwoz:fix/cluster-ready-restart-test

Conversation

@dwoz

@dwoz dwoz commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the nightly-red functional test
tests/pytests/functional/cluster/consensus/test_cluster_ready_scenarios.py::TestClusterReadyOnRestart::test_cluster_ready_fires_on_restart_from_persisted_log
on 3008.x by aligning its Phase 2 preconditions with the Raft log
persistence semantics that landed shortly after the test was written.

Summary

  • The test was added by Fix cluster_ready never fires after restart from persisted Raft state #70754 and still describes the pre-persistence
    behaviour (commit_index == -1, empty SM, empty fired2 after restart).
  • Backport cluster correctness fixes to 3008.x #70755 (commits 3e87ddd8bd8, backport 7af42dd28e0) added
    commit_index + last_applied persistence to the Raft log and made
    RaftService.__init__ call reconcile_membership during construction.
    That shifted the observable restart state and moved _on_membership_change
    firing to inside __init__, so the test's post-construction wiring of
    _on_ready left fired2 empty.
  • This change updates Phase 2 preconditions to match the persisted state
    and rewires the on_ready callback through RaftService.__init__ via a
    locally-scoped subclass in _make_cluster_with_ready_tracking so the
    callback is in place before reconcile_membership fires.
  • Test-only; no production code changed.

Context

Upstream saltstack/salt-nightlies run 42943653500 is on attempt 5, still
red on this exact slice (functional zeromq 1) across 15 OSes and 2 FIPS
variants. Red since #70754 merged 2026-11-10 11:01 UTC.

Local verification on 3008.x (venv314/bin/pytest):

  • TestClusterReadyOnRestart::test_cluster_ready_fires_on_restart_from_persisted_log: PASS
  • TestClusterReadyOnRestart class (3 tests): 3/3 PASS
  • test_cluster_ready_scenarios.py file (16 tests): 16/16 PASS
  • pre-commit run --files tests/.../test_cluster_ready_scenarios.py: clean

Test plan

  • Target test passes locally against origin/3008.x after this change
  • Full TestClusterReadyOnRestart class (3 tests) passes locally
  • Full test_cluster_ready_scenarios.py file (16 tests) passes locally
  • pre-commit clean on the touched test file
  • CI nightly functional zeromq 1 slice goes green after merge
  • No regressions in adjacent consensus/cluster functional tests

Changelog

A placeholder entry is staged as
changelog/RENAME_TO_PR_NUMBER.fixed.md -- this must be renamed to
changelog/<PR-number>.fixed.md once this PR is assigned a number (Salt's
Check Changelog Entries pre-commit hook requires a numeric filename).

References

…emantics

PR saltstack#70755 added commit_index + last_applied persistence to the Raft log
(commits 3e87ddd, backport 7af42dd); the test's docstring and
Phase 2 assertions still described the pre-fix behaviour where
commit_index came back as -1 after restart.  Update preconditions to
match persisted state, and rewire the on_ready callback since
RaftService.__init__ now fires reconcile_membership during
construction (which left fired2 empty when the callback was wired
post-construction).
@dwoz
dwoz requested a review from a team as a code owner November 12, 2026 04:56
@dwoz dwoz added the test:full Run the full test suite label Nov 12, 2026
@dwoz dwoz added this to the Argon v3008.7 milestone Nov 12, 2026
@dwoz
dwoz merged commit 74dc9d0 into saltstack:3008.x Nov 12, 2026
953 of 956 checks passed
@dwoz
dwoz deleted the fix/cluster-ready-restart-test branch November 13, 2026 08:30

This branch was previously deployed

1 inactive deployment
ci — 5f0b5a83 Deployed Nov 12, 2026 by dwoz via Build Onedir Packages / RPM (x86_64) #28819
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant