test(scheduler-core): add core contract test for full push-go-drain-end cycle (task 4.6)
Adds test_core_full_cycle.c: drives xce_core_push_events() -> xce_core_go() -> decision drain -> xce_core_end_session() end-to-end against a real picker pthread (running the real xce_job_picker_iface_t hooks on a test-local stub picker) and a main-thread stand-in allocator, since sched_allocator() is xce_scheduler_t*-coupled and out of pure-core scope. Proves both preconditions (core_go reentrancy, push_events mid-session) reject against a genuinely active session and recover once it ends. Closes out group 4 (Foundation: Scheduler Core Extraction) -- tasks 4.1-4.6 all complete. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019dw5WnN3DXStaEaPYfACU1
This commit is contained in:
parent
c5432f7786
commit
19d8df3532
3 changed files with 768 additions and 1 deletions
|
|
@ -124,11 +124,12 @@
|
|||
- _Verified: 2026-08-03 — xce_core_now() (new core_clock.c, kept out of core.c so test_core_isolation.c's wall-clock scan still passes) implements the exact two-anchor+speed formula; all 4 modes proven with fixed anchors, no sleep-based flakiness. requirements.md's literal tlog_reg_format_func(fn, core_ptr) call shape doesn't exist in the real vendored tlog API (verified against tlog.h: registration takes only the callback, userptr is per-call-site) — resolved via a module-level active-core pointer read by a new core-scoped format function, not wired into mylog_init()/main.c yet. session_start/session_duration_ns stamped correctly in xce_core_go()/xce_core_end_session() (task 4.4's behavior otherwise untouched). 18/18 scheduler suite passing, clang-format clean, review APPROVED first pass. Follow-up noted: core_clock.c is the 3rd core-adjacent file (after core_events.c, core_session.c) outside test_core_isolation.c's nm-based audit — manually verified clean, not mechanically enforced._
|
||||
- _Depends: 4.1_
|
||||
|
||||
- [ ] 4.6 Core contract tests
|
||||
- [x] 4.6 Core contract tests
|
||||
- Test the full push-events → start-session → drain-decisions → end-session cycle against a stub picker (no driver needed), asserting hook firing order and timing
|
||||
- Observable: the contract test suite passes, exercising both the batch-push precondition (rejects mid-session) and the double-session-start rejection
|
||||
- _Requirements: 5.1, 5.2_
|
||||
- _Depends: 4.4_
|
||||
- _Verified: 2026-08-03 — new test_core_full_cycle.c drives push_events→go→drain→end_session against a real picker pthread (running the real xce_job_picker_iface_t hooks on a test-local stub picker) plus a main-thread stand-in allocator (sched_allocator() is xce_scheduler_t*-coupled, out of pure-core scope) calling real on_dispatch/on_pend/make_dispatch_decision/make_pend_decision. Both preconditions (-EINVAL reentrant core_go, -EBUSY mid-session push_events) proven against a genuinely active session, not a hand-set flag, and proven to un-latch after the session ends. Two live RED→GREEN reproductions (neutered each guard in turn), both independently reproduced by review. 19/19 scheduler suite passing, clang-format clean, 30/30 stress runs with zero flakiness, review APPROVED first pass. Zero production files touched — test-only, as scoped._
|
||||
|
||||
- [ ] 5. Core: Normal-Mode Driver
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue