myxce/src/controller/testsuite
Rongsong Shen 4c5b27cb70 test(controller): merge host/port into a 'masters' list for failover in enter_ctx
The xce_test client config previously used separate 'host' and 'port' settings
and hard-coded nmasters=1, so it could only target a single controller and
could not exercise controller HA failover.

Merge them into a single 'masters' setting (comma-separated "name=host:port"
or "host:port" entries — the same syntax as the controller --peers flag) and
parse it in enter_ctx() with the shared libxce parser xce_parse_peers(), filling
config.nmasters / config.masters[] / config.master_ports[] (capped at
N_MAX_MASTERS). The test client now fails over across controller candidates
exactly like the worker/scheduler/apiserver.

The parsed list lives in a static xce_cluster_config_t so its hostname buffers
outlive enter_ctx() (xcecli_ctx_init stores the config pointer, it does not copy
masters[]). enter_ctx() now returns -EINVAL on an invalid/empty masters setting
(callers already check rc<0). Default masters='localhost:9990' preserves the
prior single-controller default. Builds clean; 'set' shows the masters setting.
2026-06-14 14:04:49 +00:00
..
controller_test.c fix(ha-commit-engine,persist): reserve WAL lsn 0 — first entry starts at lsn 1 2026-06-14 10:46:16 +00:00
test.c test(controller): merge host/port into a 'masters' list for failover in enter_ctx 2026-06-14 14:04:49 +00:00
test_cluster_persist.c feat: wire persist_init/recover/start/stop into cluster lifecycle (P0-F) 2026-05-07 13:07:47 +00:00
test_coldstart_lsn0.c fix(ha-commit-engine,persist): reserve WAL lsn 0 — first entry starts at lsn 1 2026-06-14 10:46:16 +00:00
test_commit_barrier_reply.c fix(ha-commit-engine,persist): reserve WAL lsn 0 — first entry starts at lsn 1 2026-06-14 10:46:16 +00:00
test_commit_barrier_rollout.c fix(ha-commit-engine,persist): reserve WAL lsn 0 — first entry starts at lsn 1 2026-06-14 10:46:16 +00:00
test_commit_engine.c fix(ha-commit-engine,persist): reserve WAL lsn 0 — first entry starts at lsn 1 2026-06-14 10:46:16 +00:00
test_config_repl.c test(ha-single-leader-role): sweep all COMMITTING fixtures to direct-PRIMARY contract (task 5.1) 2026-06-13 13:59:42 +00:00
test_convergence_verification.c fix(ha-repl-hardening): snapshot fallback off-by-one — empty standby must stream, not snapshot 2026-06-14 12:10:40 +00:00
test_ctrl_metrics.c feat: P3-7 ctrl_metrics — 7 atomic counters/gauges + descriptor table + persist wiring 2026-05-08 00:04:06 +00:00
test_demotion_convergence.c feat(ha-convergence-recovery): clamped rejoin reconciliation + intake trigger (task 3.2) 2026-06-14 04:53:08 +00:00
test_e2e_capnp.c test: P0-G end-to-end smoke tests — WAL, checkpoint, hooks, GC, Cap'n Proto (P0-15a-e) 2026-05-07 13:25:17 +00:00
test_e2e_checkpoint.c test: P0-G end-to-end smoke tests — WAL, checkpoint, hooks, GC, Cap'n Proto (P0-15a-e) 2026-05-07 13:25:17 +00:00
test_e2e_gc.c test: P0-G end-to-end smoke tests — WAL, checkpoint, hooks, GC, Cap'n Proto (P0-15a-e) 2026-05-07 13:25:17 +00:00
test_e2e_hooks.c add kiro skills 2026-05-21 03:41:57 +00:00
test_e2e_wal.c test: P0-G end-to-end smoke tests — WAL, checkpoint, hooks, GC, Cap'n Proto (P0-15a-e) 2026-05-07 13:25:17 +00:00
test_egress_filter.c fix(ha-commit-engine,persist): reserve WAL lsn 0 — first entry starts at lsn 1 2026-06-14 10:46:16 +00:00
test_gc_retention.c feat: JOB_STAT_TRANSIENT, job_should_retain, worker_should_retain, dead_since (P0-5a, P0-8, P0-13) 2026-05-07 12:52:07 +00:00
test_ha_bootstrap.c fix(ha-bootstrap): skip pre-election config probe; unconfigured nodes defer to post-election fetch 2026-05-29 13:15:46 +00:00
test_ha_bootstrap_support.c feat(election-iomgr-refactor): remove old blocking election code (am_i_primary_quorum, vote_request_thread, bootstrap_config_if_needed) — task 5.3 2026-05-30 13:04:19 +00:00
test_ha_cluster.c feat: wire ha_state_t into cluster_t + HA startup/shutdown lifecycle (P1-5) 2026-05-07 14:55:48 +00:00
test_ha_connection_reuse.c feat(ha-single-leader-role): remove CTRL_PRIMARY_COMMITTING enum + remaining decls — compiler-enforced (task 5.2) 2026-06-13 14:41:42 +00:00
test_ha_ctrlhello.c feat(ha-config-bootstrap): implement OP_ctrlHello state sync handler (task 9.3) 2026-05-29 05:22:17 +00:00
test_ha_durability.c test(ha-config-bootstrap): RED-phase tests for ha-term.bin durability (task 6.1) 2026-05-28 10:11:56 +00:00
test_ha_election.c fix(ha-bootstrap): priority staggering and candidate_id in election 2026-05-30 02:48:59 +00:00
test_ha_failover.c fix(ha-config-bootstrap,ha-repl-hardening): config-less node must not win election 2026-06-14 08:58:08 +00:00
test_ha_liveness.c feat(ha-heartbeat-liveness): verify ctrlhello integration and RDHUP cancel (task 3.2) 2026-06-01 15:37:35 +00:00
test_ha_rdhup_integration.c fix(ha-config-bootstrap,ha-repl-hardening): config-less node must not win election 2026-06-14 08:58:08 +00:00
test_ha_redirect.c feat: ha_should_redirect + join.c HA redirect/nomaster guard (P1-6) 2026-05-07 15:11:53 +00:00
test_ha_repl_push.c test(ha-single-leader-role): sweep all COMMITTING fixtures to direct-PRIMARY contract (task 5.1) 2026-06-13 13:59:42 +00:00
test_ha_role.c feat(ha-single-leader-role): remove CTRL_PRIMARY_COMMITTING enum + remaining decls — compiler-enforced (task 5.2) 2026-06-13 14:41:42 +00:00
test_ha_role_lifecycle.c feat(ha-single-leader-role): remove CTRL_PRIMARY_COMMITTING enum + remaining decls — compiler-enforced (task 5.2) 2026-06-13 14:41:42 +00:00
test_ha_start_election_async.c test(ha-single-leader-role): sweep all COMMITTING fixtures to direct-PRIMARY contract (task 5.1) 2026-06-13 13:59:42 +00:00
test_ha_startup.c test(ha-single-leader-role): sweep all COMMITTING fixtures to direct-PRIMARY contract (task 5.1) 2026-06-13 13:59:42 +00:00
test_ha_vote_gate.c fix(ha-config-bootstrap,ha-repl-hardening): config-less node must not win election 2026-06-14 08:58:08 +00:00
test_ha_vote_send.c feat(election-iomgr-refactor): implement vote_reply_msg_handler 2026-05-30 08:45:43 +00:00
test_hooks.c feat: add HOOK_DETAIL_JOB_STOP/RESUME; fix xce_reply ordering after AFTER_EVENT hooks (P0-4a) 2026-05-07 12:08:52 +00:00
test_p1_integration.c chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
test_p2_integration.c fix(ha-repl-hardening): snapshot fallback off-by-one — empty standby must stream, not snapshot 2026-06-14 12:10:40 +00:00
test_p3_hardening.c fix(ha-commit-engine,persist): reserve WAL lsn 0 — first entry starts at lsn 1 2026-06-14 10:46:16 +00:00
test_p3_manual_failover.c feat: P3-6 ha_trigger_manual_failover_for_test() shim + 3 failover cycle tests 2026-05-07 23:55:00 +00:00
test_persist_checkpoint.c feat: implement persist_checkpoint with WAL marker, snapshot, trim, rotation (P0-3) 2026-05-07 11:19:08 +00:00
test_persist_hooks.c add kiro skills 2026-05-21 03:41:57 +00:00
test_persist_recovery.c feat: implement persist_recover with snapshot load and WAL replay (P0-4) 2026-05-07 11:41:33 +00:00
test_persist_repl.c feat: P2-4 wire repl_broadcast into persist_wal_async/sync_append; last_replicated_crc 2026-05-07 17:54:48 +00:00
test_persist_schema.c feat: add PersistConfig, SnapshotHeader, ReplEnvelope Cap'n Proto schemas (P0-9) 2026-05-07 10:19:33 +00:00
test_persist_truncate.c test(ha-config-bootstrap): add RED-phase tests for persist_truncate_wal_above (task 7.4) 2026-05-28 14:00:54 +00:00
test_persist_types.c feat: add persist.h — WAL types, persist_config_t, slot_key_t (P0-B) 2026-05-07 09:21:36 +00:00
test_persist_wal.c feat: add schedule_checkpoint() with WAL record-count trigger and idempotency CAS guard 2026-05-13 17:56:46 +00:00
test_repl_apply.c fix(ha-wal-replication): standby durably persists replicated WAL before ACK 2026-06-14 13:10:02 +00:00
test_repl_catchup.c feat: P2-5 repl_start/complete_catchup, repl_needs_snapshot — standby catch-up state 2026-05-07 18:14:12 +00:00
test_repl_majority.c test(ha-commit-barrier-rollout): RED tests for config barrier (task 5.1) 2026-06-12 16:31:42 +00:00
test_repl_unit.c test(ha-commit-engine): RED integration tests for ACK feed and sync-append (task 5.1) 2026-06-11 23:09:05 +00:00
test_worker_join.c add kiro skills 2026-05-21 03:41:57 +00:00