test(ha-commit-barrier-rollout): RED tests for mark_job_* guards (task 6.1)
3 RED carriers (duplicate FINISH on DONE appends a 2nd WAL entry + overwrites state; START on terminal clobbers it; replay non-equivalent) + 2 preservation pins (forward postdone PDONE-merge, fail-after-finish PERR-merge) that 6.2 must not break. Reviewer-confirmed: the UPDATE-clears-terminal arm is production-unreachable (pinned, not driven). 22 tests / 3 RED; census 508 distinct triples, only those 3 fail.
This commit is contained in:
parent
5a2fae1d37
commit
2308389eb1
4 changed files with 365 additions and 1 deletions
|
|
@ -51,6 +51,7 @@
|
|||
- key_find (xkvmgr_find) returns 1 when found, NOT 0 — queue_ctrl/worker_ctrl/job_ctrl leak this into rc: `if (rc == 0)` hook gates never fire on the found path (bug-447); any code reusing key_find's rc for success checks must normalise it.
|
||||
- Controller test binary reply observation: no xce_reply hook exists in src/lib; observe replies on a zeroed no-iomgr endpoint_t — xce_reply endpoint_enq()s onto ep->outq; drain with endpoint_deq + raw capnp read_Request/read_RequestReply (test_commit_barrier_reply.c).
|
||||
- makeJob needs job_obj_init() once per process AND xce_job_t.submit != NULL; makeString needs xstring_table_init (test_worker_join.c inits it unguarded at group entry — probe makeString for NULL before initialising to stay -t-selection safe).
|
||||
- (2026-06-13, barrier-rollout 6.1) mark_job_start/finish/fail/update are STATIC in job.c — testsuite reaches them ONLY via the non-static wrappers on_job_start/on_job_finish/on_job_fail (and on_job_postdone → mark_job_update). Those wrappers `return 0` unconditionally regardless of mark_job_* rc, so the guard's "success-no-op rc" observable is asserted on the wrapper rc (== 0). No public caller produces a terminal→non-terminal UPDATE (on_job_postdone OR's PDONE = forward; job_ctrl SIGCONT only clears suspend bits) — mark_job_start (state := JOB_STAT_RUN) is the faithful publicly-reachable terminal-clearing witness for the shared backward rule. current_lsn is the "did a hook fire / WAL append" oracle: a guarded-out no-op runs no hooks → no persist_wal_async → current_lsn frozen; combine with cbrp_count_jobstate_entries (on-disk scan) + a key_find live-state read. Controller suite baseline 2026-06-13: 502 distinct PASS triples pre-6.1; +3 with 6.1's 2 preservation pins landing green (forward-update, PERR-merge) = 505, 3 FAIL = the 3 new RED guard tests.
|
||||
|
||||
## Do-Not-Repeat
|
||||
|
||||
|
|
|
|||
|
|
@ -1011,3 +1011,10 @@
|
|||
|------|--------|---------|---------|--------|
|
||||
| 20:45 | Edited .kiro/specs/ha-commit-barrier-rollout/tasks.md | inline fix | ~37 |
|
||||
| 20:46 | Edited .kiro/specs/ha-commit-barrier-rollout/tasks.md | 1→2 lines | ~383 |
|
||||
| 20:56 | Edited src/controller/testsuite/test_commit_barrier_reply.c | added 2 condition(s) | ~4126 |
|
||||
| 20:56 | Edited src/controller/testsuite/test_commit_barrier_reply.c | expanded (+9 lines) | ~216 |
|
||||
| 20:58 | Edited src/controller/testsuite/test_commit_barrier_reply.c | TEST_ASSERT_EQUAL_INT() → WAL_JOB_START() | ~111 |
|
||||
| 04:07 | task 6.1 RED: 5 mark_job_* guard tests (3 red, 2 preservation pins) | testsuite/test_commit_barrier_reply.c | full suite 3 FAIL=new RED, 505 PASS | ~14k |
|
||||
| 04:18 | task 6.1 review: RED tests for mark_job_* guards verified | test_commit_barrier_reply.c | APPROVED — 22/3 group, 508/3 census, boundary clean | ~38k |
|
||||
| 21:19 | Edited .kiro/specs/ha-commit-barrier-rollout/tasks.md | inline fix | ~13 |
|
||||
| 21:19 | Edited .kiro/specs/ha-commit-barrier-rollout/tasks.md | modified 2() | ~243 |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue