myxce/src/controller/testsuite
Rongsong Shen 045d9e3287 feat: add HOOK_DETAIL_JOB_STOP/RESUME; fix xce_reply ordering after AFTER_EVENT hooks (P0-4a)
- cluster_def.h: add struct tag `cluster_s` to cluster_t to resolve
  conflicting typedef with persist.h forward declaration
- cluster_def.h: add HOOK_DETAIL_JOB_STOP and HOOK_DETAIL_JOB_RESUME enum
  values after HOOK_DETAIL_JOB_RUSAGE_UPDATE
- job.c on_job_stop(): replace mark_job_update() call with direct
  xce_run_hooks(BEFORE/AFTER, HOOK_DETAIL_JOB_STOP) so WAL writer
  records stop events with the correct detail value
- job.c on_job_resume(): same pattern with HOOK_DETAIL_JOB_RESUME
- job.c do_clr_preason(): fix typo — second hook call was HOOK_BEFORE_EVENT
  instead of HOOK_AFTER_EVENT (double-before, zero-after bug)
- join.c handle_worker_join(): move xce_reply() to after HOOK_AFTER_EVENT
  so client ACK is not sent before WAL write completes (durability fix)
- testsuite/test_hooks.c: new TDD tests for JOB_STOP/RESUME enum values
- testsuite/controller_test.c + meson.build: register test_hooks suite

Reply ordering audit results:
  job.c handle_jobsubmit: reply before AFTER_EVENT — intentional (jobid
    returned to client before scheduler notification; WAL hook belongs in
    BEFORE_EVENT for this path, handled in Task 13)
  job.c do_set_preason: reply before set_preason() loop — intentional
    fire-and-forget (no AFTER_EVENT hook at top level)
  job.c do_clr_preason: reply before loop — same fire-and-forget pattern
  job.c do_jobcontrol_op: no AFTER_EVENT hook, reply only — OK
  join.c handle_worker_join: FIXED (reply moved after AFTER_EVENT)
  worker.c on_worker_update/dead: reply after all hooks — OK
  cluster.c: AFTER_EVENT hooks are internal (no reply) — OK
2026-05-07 12:08:52 +00:00
..
controller_test.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.c feat: rename delaymgr precision→precision_ms, replace sleep() with nanosleep() (P0-2b) 2026-05-07 09:08:03 +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_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_recovery.c feat: implement persist_recover with snapshot load and WAL replay (P0-4) 2026-05-07 11:41:33 +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_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: persist.c WAL writer with chained CRC32 and dedicated fsync pthread (P0-1) 2026-05-07 10:00:10 +00:00