test(raft-ha-core-safety): harness infrastructure + payload-loss smoke-RED (task 1.4)

New test_ha_core_safety.c with deterministic gate/probe seams (no sleeps,
drain-before-fini per bug-1224): payload-controllable WAL writer, on-disk
(term,pcrc,len) readback probe, walcompare observer, apply-gap + kill/
election injection for phases 2.3/4.1/5.1. Smoke-RED (Expected 64 Was 0)
proves the payload-blind (term,lsn)-only guard at persist.c:822 drops a
corrective full-payload write at a committed LSN. 5 tests/1 RED/4 seam
PASS, no ASAN errors.
This commit is contained in:
Rongsong Shen 2026-06-27 09:49:51 +00:00
parent 9e55f09274
commit dc50924833
4 changed files with 415 additions and 1 deletions

View file

@ -71,6 +71,7 @@ extern void test_slowlane(void);
extern void test_commit_admission_pool(void);
extern void test_ha_vep_teardown(void);
extern void test_ha_dispatch_integration(void);
extern void test_ha_core_safety(void);
void setUp(void) { return; }
@ -211,6 +212,7 @@ int main(int argc, char* argv[])
TEST(test_commit_admission_pool);
TEST(test_ha_vep_teardown);
TEST(test_ha_dispatch_integration);
TEST(test_ha_core_safety);
return UNITY_END();
}