test(scheduler-snapshot-job-allocation): close originally-reported symptom end to end
Task 4.2: extend test_e2e_original_motivation_long_replay with PREEXIST_ID (job 70013, dedicated worker worker-e2e-pre) -- a job submitted, live-dispatched, and confirmed RUN entirely before sched_record_start(), so its dispatch decision can never appear in the replay stream. Proves its "used=9.00" resource contribution is correct starting from the very first replayed round, recoverable only via snapshot-load allocation restoration (tasks 2.1/2.2), not replay-based reconciliation -- the complementary case to the file's existing ANCHOR_ID scenario. Completes and fixes a pre-existing uncommitted WIP addendum to this file: removed a redundant enqueue_queue_update() call that was masking a genuine, unrelated latent bug in core_upsert_queue() (rtti makeString() pointer freed via plain free(), same class as bug-1503/bug-1600) -- noted in tasks.md's Implementation Notes as a follow-up, not fixed here (test-only task boundary). Verified via fault injection: gating snapshot_load.c's allocation restore reproduces the exact pre-fix failure at this test's new assertion, then cleanly reverts. Requirements: 1.1, 1.2, 1.3 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BSiC2cPVH2VSBdtFq4P4ju
This commit is contained in:
parent
de6ad514e0
commit
2654e03f2b
2 changed files with 327 additions and 6 deletions
|
|
@ -61,7 +61,7 @@
|
|||
- _Depends: 1.2_
|
||||
- _Boundary: snapshot load (scheduling-representation construction), test_snapshot_save_load.c_
|
||||
|
||||
- [ ] 4.2 (P) Reproduce and close the originally-reported resource-accounting symptom end to end
|
||||
- [x] 4.2 (P) Reproduce and close the originally-reported resource-accounting symptom end to end
|
||||
- Extend the existing simulation-mode scenario that already reproduces the reported symptom (a saved state with many running jobs, replayed forward) to assert that every running job's resource contribution is correctly reflected immediately after loading, not only the jobs whose dispatch also happens to appear later in the replay.
|
||||
- Observable completion: the extended end-to-end scenario passes, showing 100% of the saved running jobs' resource contribution accounted for immediately on load.
|
||||
- _Requirements: 1.1, 1.2, 1.3_
|
||||
|
|
@ -89,3 +89,6 @@
|
|||
- Observable completion: the audit dimension reports clean, with this feature's fields correctly classified as fixed or documented.
|
||||
- _Requirements: 3.2, 3.3, 3.4_
|
||||
- _Depends: 4.1, 4.2, 4.3, 4.4_
|
||||
|
||||
## Implementation Notes
|
||||
- Task 4.2 side-finding (not fixed here, out of boundary): `core_upsert_queue()`'s existing-queue branch (`core_events.c:335-336`) calls `FREEUP(q->resreq)` (plain `free()`) on a `resreq` that was set via the rtti-backed `makeString()` (mismatched allocator/free, same bug class as already-fixed bug-1503/bug-1600). Reproducible via any second `QUEUE_UPDATE` for a queue whose `resreq` was ever populated via `makeString()` — not specific to snapshot restoration; the near-identical pattern already exists in the legacy `sched_update_existing_queue()` (`schedobj.c:573-575`). Confirmed real by two independent readings (implementer + reviewer). Needs its own buglog.json entry and likely a separate follow-up task — tracked here so it isn't lost.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue