myxce/src/controller/testsuite
lei.chen 0c8607345e merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits)
Merge origin/scheduler-framework into merge-sf-20260903 (97 commits on
ours: bug-1490/1494/1498/1509/1513/1521/1522 fixes, PEND-reason P1,
scheduler-agent Phase 2, bug-924 owner-pid shim).

Bookkeeping excluded per policy: .kiro/, .wolf/, CHANGES.md, reports/
(92 files dropped); .claude/ + CLAUDE.md keep ours.

Key theirs-side changes absorbed:
- bug-1938/1960: QUEUE_STAT_CLOSED no longer gates dispatch (closed
  queue refuses new submissions only; pending jobs still run) --
  supersedes our QUEUE_CLOSED preason on the dispatch path;
  sched_queue_status_reason drops that branch
- bug-1846: config push now stashes and applies between scheduling
  rounds (sched_stash_config/sched_apply_pending_config), applied at
  the same main-thread round boundary that preserves bug-1513
  serialization
- bug-1760: sched_check_pending_rejoin exposed +
  xcecli_is_connection_broken public predicate
- bug-1936: execuser/exechome/execcwd/exdata carried on submission
  (superset of our bug-1500 execuser fallback; our job-typed
  resolveExecUser removed as dead code)
- bug-1945~1962: apiserver auth hardening (HS256 pinning, default-
  secret rejection, logout revocation, bcrypt, RBAC) -- our API-key
  branch folded into controllers.ParseTokenClaims so both coexist
- bug-1736: rawRunUsage job run-usage fields in the Go model
- xce_test relocated src/controller/testsuite/test.c ->
  src/harness/test.c; controller suite split into
  controller_test.c + fixtures; their clitest fixtures spawn xce_test
  mid-suite under `meson test -j`

Ours preserved across the merge:
- PEND-reason P1 (codes 1-9, preason.h, job_preason machinery) --
  gate re-ported into their relocated allocator (sched_election.c)
  after plugin_job_election, with attach on the allocator thread
  only (bug-1521 race discipline)
- PEND-reason P0 main_reason semantics RECONCILED to theirs: the
  merge initially re-carried our first-detail-add-promotes-main_reason
  fallback in add_job_preason (4e2ac86), but their whole trace/verify
  stack treats "detail-only => main_reason 0" as a contract --
  sched_trace_capture counts main_reason as its own occurrence
  ("Expected 2 Was 3" in test_trace_capture), the outcome renderer
  prints "main reason: none" for detail-only PENDs (test_repl_trace_e2e),
  and the committed .replay/.sim_verify baselines encode main_reason=0
  (test_repl_trace_baseline byte compare, test_trace_equivalence
  off-vs-traced). The fallback is dropped from the shared lib;
  the user-visible "overall reason" survives as an API-layer view:
  rawJobToModel (convert_pure.go) promotes the first detail row to
  main_reason_name when main_reason is 0 (main_reason VALUE marshals
  unchanged). add_job_preason keeps only the NULL-reasons guard
- bug-1498: sched_job_is_ready rejects non-PEND/suspended jobs
- bug-1490/1781: xce_jobctrl_t.action as capnp union discriminant
  (their jobCtrlUnionDiscriminant, same semantics)
- xcecli typed PendingReason field (53c00834), bug-1522 reconnect
  resend, xcecli_force_reconnect + their is_connection_broken both
  exported in client.h/libclient
- t1/t2/t3 test-node hostconfig in src/configs/hosts.yaml (bug-1494),
  /xce/v1/events + /xce/v1/apikeys whitelist routes (agent Phase 2)
- lib ASAN_OPTIONS=detect_leaks=0 test env + their oom-test block
- drop-audit: our bug-1504 fix covered by their bug-1680 (no action)

bug-924 follow-up (replaces the 67f3f6ad scratch-dir wipe): the
take-theirs audit's one "drop" was re-evaluated and REVERTED instead of
re-applied -- a global `find /tmp -name 'xce_*' -exec rm -rf` at suite
start/exit races the LIVE /tmp/xce_* fixtures of sibling suites under
`meson test -j` (harness_unit_test's clitest fixtures spawn xce_test as
a child mid-suite; the wipe destroyed the parent's fixtures ->
test_test_cli failures). Coverage instead:
- mkdtemp_clean shim gains mkdtemp_clean_mark/sweep_since
  (testsuite_support/mkdtemp_clean.[ch])
- new case_scratch_sweep.[ch]: aggregate runners (controller_test.c,
  harness_test.c -- hundreds of cases per process) call
  case_scratch_sweep_begin/_end_ok from setUp/tearDown; a PASSED case's
  dirs are swept immediately in tearDown (after engine reaping), FAILED
  cases keep their dirs for post-mortem; XCE_MKDTEMP_KEEP_ALL=1
  disables. One full controller_unit_test run was observed to leak 12G+
  to ENOSPC without this, cascading into unrelated "Expected Non-NULL"
  failures
- harness_unit_test_deps links the shim library as well

Test reconciliations on adopt:
- core-ready-gates: sched_queue_is_ready now gates only
  INACT_ADMIN|INACT_WINDOW (bug-1938/1960); CLOSED queues elect --
  covered end-to-end by test_queue_admin_control.c
- test_worker_resync: the 4 restart-replay RUN assertions predate the
  bug-1509 B3 marking (8858afed) landing on the same lineage; replayed
  RUN jobs now assert RUN|UNKWN|TRANSIENT (TWR_ASSERT_REPLAYED_RUN);
  terminal DONE/EXIT assertions unchanged
- convert_pure.go: our job-typed resolveExecUser deleted (superseded
  by their bug-1780/1936 two-arg version)
- test_preason: the 3 P0-promotion assertions reverted to the
  detail-keeps-main-0 contract; new tests cover limit-code detail
  rows and explicit-main-wins-over-later-details; apiserver
  convert_test.go gains the detail-only name-promotion cases

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-14 05:17:03 +00:00
..
clean_failover_preservation.sh fix(controller-test): clean_failover_preservation.sh runs again (bug-1721) 2026-09-30 03:51:20 +00:00
controller_test.c merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits) 2026-10-14 05:17:03 +00:00
test_apply_committed_entry.c fix(controller): reject submissions to closed or unknown queues (bug-1960) 2026-10-10 10:38:42 +00:00
test_apply_correctness_verification.c fix(controller): checkpoints no longer punch a hole in the replicated log (bug-1870) 2026-09-26 15:16:46 +00:00
test_apply_pump.c merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits) 2026-10-14 05:17:03 +00:00
test_apply_pump_integration.c fix(controller): reject submissions to closed or unknown queues (bug-1960) 2026-10-10 10:38:42 +00:00
test_apply_reapply_idempotency.c fix(bug-1731): fire HOOK_DETAIL_JOB_START/JOB_EXIT on WAL apply 2026-08-29 11:29:10 +00:00
test_apply_seam.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_bug857_regression.c feat(config-upgrade-snapshot): add bug-857 regression test, correct design.md (task 8.5) 2026-07-25 10:44:14 +00:00
test_cluster_persist.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_coldstart_lsn0.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_commit_admission_pool.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_commit_barrier_reply.c fix(controller): reject submissions to closed or unknown queues (bug-1960) 2026-10-10 10:38:42 +00:00
test_commit_barrier_rollout.c fix(controller): size the config-push barrier for loaded hosts and admit its wait (bug-1914) 2026-10-04 23:59:29 +00:00
test_commit_durability.c fix(controller): refuse replicated WAL writes before this boot's recovery (bug-1920) 2026-10-04 12:02:37 +00:00
test_commit_engine.c fix(bug-1429): persist_stop() before commit_engine_fini() in 21 fixtures 2026-08-30 16:04:43 +00:00
test_commit_resolve.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_config_queue_reconcile.c fix(controller): a queue added by a live config upgrade exists without a restart (bug-1469) 2026-09-27 06:05:26 +00:00
test_config_repl.c merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits) 2026-10-14 05:17:03 +00:00
test_convergence_verification.c fix(controller): refuse replicated WAL writes before this boot's recovery (bug-1920) 2026-10-04 12:02:37 +00:00
test_ctrl_metrics.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_ctrlstatus.c fix(controller): cold start elects in ~1.7 s, not ~10 s; ctrlstatus appliedLsn on the primary (bug-1879, bug-1878) 2026-09-28 07:35:45 +00:00
test_demotion_convergence.c fix(controller): offload demotion convergence and catch-up streaming by default (bug-1450, bug-1451) 2026-09-27 05:46:09 +00:00
test_dispatch_commit.c merge: sync Rongsong's scheduler-framework (122 commits, 070c7869..f01ae353) 2026-08-31 14:24:17 +00:00
test_dispatch_fail_retry.c fix: the controller is the ground truth for job state on scheduler rejoin (bug-1860) 2026-09-27 04:32:37 +00:00
test_dispatch_fail_terminal.c feat(scheduler-dispatch-commit): controller resolves terminal dispatch failures to EXIT (task 3.2) 2026-08-23 16:36:39 +00:00
test_drive_async_config.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_e2e_capnp.c fix(controller): CtrlHelloRequest.key Data field crashed HA leader election (bug-1835) 2026-09-21 03:51:48 +00:00
test_e2e_checkpoint.c fix(controller): close 6 data-safety races + apply-pump O(N^2) regression + boot TOCTOU 2026-08-16 10:20:02 +00:00
test_e2e_gc.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_e2e_hooks.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_e2e_wal.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_egress_filter.c fix(bug-1429): persist_stop() before commit_engine_fini() in 21 fixtures 2026-08-30 16:04:43 +00:00
test_fetchfile_disconnect.c fix(controller): fail loud on scheduler/worker disconnect instead of relying on the reply-wait timeout (bug-1693) 2026-08-25 14:13:26 +00:00
test_gc_retention.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_ha_bootstrap.c feat(eliminate-frontend-makefile): task 3.4 - update source code comments 2026-09-03 14:34:48 +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(controller-peers-env-fallback): route the controller's two identity loops through the shared lookup (task 2.1) 2026-10-03 05:54:48 +00:00
test_ha_connection_reuse.c fix(controller): never close() the primary channel's raw fd (bug-1865) 2026-09-25 14:55:04 +00:00
test_ha_core_safety.c test(raft-adapter-conformance): WAL catch-up reject reply-construction regression lock 2026-07-29 16:11:47 +00:00
test_ha_ctrlhello.c feat(eliminate-frontend-makefile): task 3.4 - update source code comments 2026-09-03 14:34:48 +00:00
test_ha_dispatch_integration.c fix(controller): run the become-leader tail on a task class that may block (bug-1433) 2026-09-27 05:52:38 +00:00
test_ha_durability.c fix(controller): raft_cb_persist must deny vote and roll back state on persist failure (bug-1684) 2026-08-25 07:49:49 +00:00
test_ha_elect_ctx_lifecycle.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_ha_election.c fix(controller): clamp committed_config_tag to own loaded config on promotion 2026-07-23 04:23:50 +00:00
test_ha_failover.c fix(controller): never close() the primary channel's raw fd (bug-1865) 2026-09-25 14:55:04 +00:00
test_ha_failover_prevote.c fix(controller): cold start elects in ~1.7 s, not ~10 s; ctrlstatus appliedLsn on the primary (bug-1879, bug-1878) 2026-09-28 07:35:45 +00:00
test_ha_heartbeat_committed.c feat(controller-status): carry election time on the heartbeat (task 7.3) 2026-09-16 06:03:03 +00:00
test_ha_liveness.c fix(controller): scan standby_endpoints by capacity, not count (bug-1474) 2026-09-27 06:01:11 +00:00
test_ha_partition.c feat(controller-status): carry election time on the heartbeat (task 7.3) 2026-09-16 06:03:03 +00:00
test_ha_prevote.c fix(controller,lib): decide each PreVote round once and promote only with this election's votes (bug-1915) 2026-10-04 09:14:38 +00:00
test_ha_rdhup_integration.c fix(ha): close standby election-freeze (bug-1562) + flusher retry storm (bug-1563) 2026-08-17 06:35:06 +00:00
test_ha_redirect.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_ha_repl_push.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_ha_role.c feat(controller-status): stamp election time on both promotion roads (task 7.2) 2026-09-16 04:54:25 +00:00
test_ha_role_lifecycle.c fix(bug-1429): persist_stop() before commit_engine_fini() in 21 fixtures 2026-08-30 16:04:43 +00:00
test_ha_start_election_async.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_ha_startup.c fix(controller): restored-but-stale raft term permanently blocked re-election after restart (bug-1695) 2026-08-25 16:11:37 +00:00
test_ha_vep_teardown.c fix(controller): standby-endpoint err handler freed ep->data under a live vtask (bug-1839) 2026-09-22 03:21:14 +00:00
test_ha_vote_floor_heartbeat.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_ha_vote_gate.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_ha_vote_send.c fix(controller,lib): decide each PreVote round once and promote only with this election's votes (bug-1915) 2026-10-04 09:14:38 +00:00
test_hooks.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_host_runusage.c feat(controller): compute the LSF CPU peak and efficiency fields (bug-1736) 2026-10-02 04:14:35 +00:00
test_job_array_apiserver_push.c fix(schema): rename struct Data -> XceData to unshadow capnp builtin blob type 2026-07-22 09:22:04 +00:00
test_job_array_apply.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_job_array_fence.c fix(bug-1429): persist_stop() before commit_engine_fini() in 21 fixtures 2026-08-30 16:04:43 +00:00
test_job_array_replay_fence.c fix(bug-1429): persist_stop() before commit_engine_fini() in 21 fixtures 2026-08-30 16:04:43 +00:00
test_job_array_sched_push.c fix(controller): fail loud on scheduler/worker disconnect instead of relying on the reply-wait timeout (bug-1693) 2026-08-25 14:13:26 +00:00
test_job_ctrl_hosts.c fix(controller): send job control to every host of a multi-host job (bug-1942) 2026-10-10 08:43:53 +00:00
test_job_dispatch.c feat(scheduler-dispatch-commit): add controller dispatch-failure classification (task 1.1) 2026-08-23 06:36:51 +00:00
test_job_dispatch_fail_count.c feat(scheduler-dispatch-commit): add dispatch-fail retry counter to job_t (task 1.3) 2026-08-23 07:44:22 +00:00
test_jobdispatch_no_double_notify.c test(scheduler-dispatch-commit): terminal dispatch failure e2e coverage (task 5.3) 2026-08-23 20:47:15 +00:00
test_jobstatereport_dispatch.c feat(worker-rejoin-resync): task 6.2 - route job-state report to reconciliation 2026-09-01 21:06:42 +00:00
test_jobsubmit_validate.c fix(controller): reject submissions to closed or unknown queues (bug-1960) 2026-10-10 10:38:42 +00:00
test_join_redirect.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_late_joiner_catchup_kick.c fix(controller): probe a late-joining standby at once so its catch-up starts without waiting a heartbeat (bug-1913) 2026-10-03 23:18:10 +00:00
test_p1_integration.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_p2_integration.c fix(bug-1429): persist_stop() before commit_engine_fini() in 21 fixtures 2026-08-30 16:04:43 +00:00
test_p3_hardening.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_p3_manual_failover.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_persist_checkpoint.c fix(controller): resume at checkpoint+1 after loading a snapshot (bug-1870 follow-up) 2026-09-27 06:47:30 +00:00
test_persist_checkpoint_offload.c fix(controller): offload checkpoint_task_fn off the delaymgr thread (bug-1694) 2026-08-25 14:54:53 +00:00
test_persist_encryption.c fix: spurious errors/warnings from a pc13v HA deploy (bug-1872..1877) 2026-09-28 04:35:19 +00:00
test_persist_hooks.c fix(controller): close 6 data-safety races + apply-pump O(N^2) regression + boot TOCTOU 2026-08-16 10:20:02 +00:00
test_persist_recovery.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_persist_repl.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_persist_schema.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_persist_snapshot_entities.c fix(controller,apiserver,xcecli): expose job CPU peak and efficiency to the apiserver and xcecli (bug-1736) 2026-10-06 13:54:43 +00:00
test_persist_truncate.c fix(controller): bug-1452 fix commit_engine_fini/persist_stop teardown race 2026-07-19 09:27:50 +00:00
test_persist_types.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_persist_wal.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_phase2_cold_boot.c fix: spurious errors/warnings from a pc13v HA deploy (bug-1872..1877) 2026-09-28 04:35:19 +00:00
test_rcfile_integration.sh fix: repoint stale controller/xce_test path references to harness/xce_test 2026-09-14 11:49:01 +00:00
test_repl_apply.c fix(controller): job.start_time never set -- dispatch/WAL_JOB_START RUN-state collision (bug-1697) 2026-08-27 08:25:40 +00:00
test_repl_catchup.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_repl_majority.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_repl_unit.c fix(repl): harden standby slot allocation against WAL-retention guard clobber (bug-1474) 2026-07-26 04:11:27 +00:00
test_replay_apply_seam.c fix(controller): mark RUN jobs unknown on worker loss and restart (bug-1509 P2) 2026-08-06 05:57:59 +00:00
test_sched_admin_dispatch.c fix(controller): standby dispatch-gate rejections now redirect to a known primary (bug-1700, bug-1701) 2026-08-27 08:25:55 +00:00
test_sched_worker_change.c fix(controller): fail loud on scheduler/worker disconnect instead of relying on the reply-wait timeout (bug-1693) 2026-08-25 14:13:26 +00:00
test_slowlane.c fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide 2026-07-17 14:49:12 +00:00
test_standby_state_peer_idx.c fix(controller): record standby state under its absolute peer index (bug-1891) 2026-09-29 15:12:53 +00:00
test_term_adoption_vectors.c test(ha): add term-adoption regression tests for heartbeat/WAL-NACK vectors (bug-1484) 2026-08-02 04:36:46 +00:00
test_term_safety_adapter.c fix(controller): refuse replicated WAL writes before this boot's recovery (bug-1920) 2026-10-04 12:02:37 +00:00
test_upgrade_snapshot_apply.c test(config-upgrade-snapshot): fault-inject crash/restart + leadership change (task 8.7) 2026-07-25 18:20:43 +00:00
test_upgrade_snapshot_restore.c feat(config-upgrade-snapshot): restore host admin-state frame safely (create-if-missing) 2026-07-24 12:48:28 +00:00
test_wal_job_ckpt_fact.c merge-fix: reconcile Rongsong WAL-fact replay tests with bug-1509 B3; lib test leak-detection convention 2026-08-31 14:57:49 +00:00
test_wal_job_dispatch_fact.c merge: sync Rongsong's scheduler-framework (122 commits, 070c7869..f01ae353) 2026-08-31 14:24:17 +00:00
test_wal_job_fail_fact.c fix(controller): persist a failed job's finish_time through WAL_JOB_FAIL (bug-1747) 2026-09-26 09:33:55 +00:00
test_wal_job_finish_fact.c fix(bug-1731): fire HOOK_DETAIL_JOB_START/JOB_EXIT on WAL apply 2026-08-29 11:29:10 +00:00
test_wal_job_preason_fact.c fix(controller): WAL_JOB_PREASON loses job.pend_reasons on replay (bug-1692) 2026-08-25 13:14:28 +00:00
test_wal_job_rusage_fact.c merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits) 2026-10-14 05:17:03 +00:00
test_wal_job_start_fact.c merge-fix: reconcile Rongsong WAL-fact replay tests with bug-1509 B3; lib test leak-detection convention 2026-08-31 14:57:49 +00:00
test_worker_join.c fix(controller): resource hooks only carry values the controller accepted (bug-1583) 2026-09-27 03:19:17 +00:00
test_worker_resync.c merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits) 2026-10-14 05:17:03 +00:00