forked from lei.chen/myxce
test(ha-commit-engine): RED tests for WAIT mode, admission cap, own-term gate (task 2.1)
9 new cases (8-16): block-until-majority, deadline timeout, standalone fast path, zero-ACK regression, n_vcpus-relative cap with floor, ACK progress at saturation, gate as blocking predicate (NOT_READY is admission-cap-only per corrected contract). Main-thread-only assertions after joins; 16 tests / 9 RED failures; baseline unchanged.
This commit is contained in:
parent
eae4767d7d
commit
d91f446e9e
4 changed files with 405 additions and 7 deletions
|
|
@ -18,7 +18,7 @@
|
|||
- _Requirements: 1.2, 2.1, 2.2, 2.3, 5.1_
|
||||
|
||||
- [ ] 2. WAIT mode, self-quorum, zero-peer rule, admission cap, own-term gate storage
|
||||
- [ ] 2.1 Write RED tests for blocking-wait semantics and admission control
|
||||
- [x] 2.1 Write RED tests for blocking-wait semantics and admission control
|
||||
- Tests in `test_commit_engine.c`: WAIT blocks until majority ACK then returns 0; WAIT returns `-ETIMEDOUT` at deadline with `committed_lsn` unmoved past the entry; n_peers=1 → WAIT returns 0 immediately and `committed_lsn` advances to the entry; n_peers=3 with zero standby ACKs → `-ETIMEDOUT`, never success (short-circuit regression); with n_vcpus=8 and reserved=2, a 7th concurrent WAIT gets `-XCE_ERR_NOT_READY` while the 6 admitted waits proceed; cap floor `max(1, n_vcpus - reserved)` holds for tiny n_vcpus; while the cap is saturated, `commit_on_ack` still advances `committed_lsn` and completes admitted waiters; `writable_lsn` unset (0) → no gating; `commit_set_writable_lsn(G)` with G > entry → waiter completes only once `committed_lsn >= G`
|
||||
- Observable completion: new cases FAIL (red) against the task-1 engine
|
||||
- _Requirements: 1.1, 4.3, 4.4, 6.3, 7.1, 7.2, 7.3_
|
||||
|
|
@ -85,3 +85,4 @@
|
|||
- (1.1) Full-suite output under default ASAN dies at exit via LeakSanitizer (pre-existing leaks in worker_join/rdhup_integration/start_election_async/liveness groups) without flushing stdout — use ASAN_OPTIONS=detect_leaks=0 for full-run logs or run groups standalone with -t.
|
||||
- (1.1) repl_add_standby returns the SLOT INDEX, not 0 (bug-410 note for fixture writers).
|
||||
- (1.1) commit.c is registered ONLY in controller_unit_test_src for now; production target linkage lands with task 5.3.
|
||||
- (2.1) WAIT/cap/gate tests (8-16) read `g_ce.inflight_waits` under `g_ce.lock` — task 2.2 must keep that field accurate while waiters block. Timing floors have ~20ms slack vs sleeps (reviewer advisory: watch for flake on loaded boxes). Unity assertions are main-thread-only after joins — keep that discipline in future threaded tests.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue