Skip to content

CI: Tier B failover test script (automated) #48

@renecannao

Description

@renecannao

Automated Failover Tests

Codify all Tier B failover tests into a reproducible script.

Tests (from manual session)

  1. Verify pre-failover topology (mysql1=master, mysql2/mysql3=replicas)
  2. Verify ProxySQL HG 10=mysql1, HG 20=mysql2+mysql3
  3. Graceful takeover: curl /api/graceful-master-takeover/...
  4. Verify: mysql2 promoted to master (read_only=0)
  5. Verify: mysql1 demoted to replica (read_only=1)
  6. Verify: ProxySQL HG 10 updated to mysql2
  7. Verify: ProxySQL HG 20 has mysql1 as OFFLINE_SOFT
  8. Restore topology (mysql1=master)
  9. Hard failover: docker stop mysql1
  10. Wait for orchestrator to detect DeadMaster (max 30s)
  11. Verify: Replica promoted to master
  12. Verify: ProxySQL writer hostgroup updated to new master
  13. Verify: /api/v2/recoveries shows recovery event with IsSuccessful=true
  14. Restore mysql1 container

Files

  • tests/functional/test-failover.sh

Acceptance criteria

  • Script exits 0 if all tests pass
  • Graceful takeover + ProxySQL hook validated
  • Hard failover + ProxySQL hook validated
  • Recovery API audit verified
  • Topology restored after each test

Depends on #46 (infrastructure) and #47 (smoke tests pass first).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions