test(scheduler-allocator-runner): characterize the seqjob allocator (task 2.1)
12 tests drive the real seqjob plugin through job_alloc_fn and record today's results, reasons and debits, with switch-stable OOM injection (sched_make_allocs stub, --wrap of make_host_alloc/make_job_alloc). Assertions the runner changes on purpose sit in *_today tests. The characterization showed bug-1893's real effect: vget() returns 0 on success, so the shared-reason loop (rc <= 0 skip) never records a shared NO_RESOURCE reason. Bug record and spec wording corrected; the runner skips only on rc < 0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
31ad79d325
commit
91a8580948
8 changed files with 835 additions and 16 deletions
|
|
@ -14,7 +14,7 @@
|
|||
- _Requirements: 1.2, 1.6_
|
||||
|
||||
- [ ] 2. Characterization tests against the current allocators
|
||||
- [ ] 2.1 Characterize the sequential-job allocator through its registered entry point
|
||||
- [x] 2.1 Characterize the sequential-job allocator through its registered entry point
|
||||
- New test target that drives the real seqjob plugin through its job-allocation entry point, using the existing prepare-allocation stub convention and an allocation-record stub with out-of-memory injection
|
||||
- Set up the out-of-memory injection that 2.2 reuses, using only injection points that stay the same across the switch: the existing allocation-record stub failing on its N-th call (per-host records in claim order, then shared records) and link-time wrapping (the testsuite's existing wrap precedent) of the libxce host-allocation and job-allocation constructors with fail-on-call-N counters; the host-array allocation is not injected here because its origin changes at the switch (seqjob's libxce helper and parjob's in-file allocation both become a runner allocation) and is covered by 3.3
|
||||
- Fixtures: success; pending on a shared resource where the job requests exactly the shared resources that are short (so bug-1893's extra reasons cannot appear); pending on hosts with the pre-filter state arranged so no host is skipped on stale state (assert host reasons only where 3.7 does not change them, and the main reason); out of memory at the host allocation, the job allocation and the shared records (today's result code and allocation state; for the host-allocation case the per-host debit is asserted separately so 4.2 can change it); task counts 0 and 2 reaching the plugin directly; the second primary of a COMPOUND job with non-overlapping resources (bug-1892 not exercised)
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
- [ ] 4. Move both allocators onto the framework routine
|
||||
- [ ] 4.1 Switch the parallel-job allocator
|
||||
- First add the parjob bug-1893 fixture (two shared resources, one short: only the short one is named) to the parjob characterization tests and see it fail against the old code
|
||||
- First add the parjob bug-1893 fixture (two shared resources, one short: exactly one host-less reason, naming the short one; today none is recorded) to the parjob characterization tests and see it fail against the old code
|
||||
- Give parjob its allocator contract with a task-count acceptance guard (more than one task), register the framework routine as its allocation entry point, and remove its private allocation routine and claim helpers
|
||||
- Build the runner into the parjob characterization target (2.2) so it keeps reaching the plugin through its entry point
|
||||
- Update the parjob combinatorial tests, the only permitted kind of change: build the runner into the white-box test, give their hand-built plugin structs the parjob allocator contract, and call the framework routine and the framework's claim search and rollback instead of the removed helpers
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
- _Requirements: 1.1, 1.2, 1.5, 1.6, 2.2, 5.2, 7.1_
|
||||
|
||||
- [ ] 4.2 Switch the sequential-job allocator
|
||||
- First add the seqjob intentional-change fixtures to the seqjob characterization tests and see them fail against the old code: a candidate host that the stale per-host request left by the job-level pass used to skip is now checked; complete per-host "no resource" reasons for every selection-matching short host with the main reason unchanged; bug-1893; release of the claimed host's debit when result building runs out of memory (this rewrites the 2.1 host-allocation out-of-memory fixture's per-host debit assertion to the new expected value)
|
||||
- First add the seqjob intentional-change fixtures to the seqjob characterization tests and see them fail against the old code: a candidate host that the stale per-host request left by the job-level pass used to skip is now checked; complete per-host "no resource" reasons for every selection-matching short host with the main reason unchanged; bug-1893 (the 2.1 fixture that records no shared reason today now expects one host-less reason naming the short resource); release of the claimed host's debit when result building runs out of memory (this rewrites the 2.1 host-allocation out-of-memory fixture's per-host debit assertion to the new expected value)
|
||||
- Give seqjob its allocator contract with no acceptance guard, register the framework routine as its allocation entry point, and remove its private allocation routine
|
||||
- After the switch, add seqjob missing-input fixtures (invalid-argument, no pend-reason record)
|
||||
- Build the runner into the seqjob characterization target (2.1)
|
||||
|
|
@ -94,3 +94,6 @@
|
|||
## Implementation Notes
|
||||
- Build/test only in the dedicated dir `src/build.alloc` (`bash src/tools/xce-build.sh scheduler asan build.alloc --jobs N --incremental`; baseline 90/90). Another session uses `src/xce.build`.
|
||||
- Several white-box scheduler test targets run with `detect_leaks=0` because their fixtures are not torn down (`testsuite/meson.build:1756`); a leak summary from running such a binary directly is pre-existing, not a regression. New tests that assert "no leak" (3.3) need leak detection on for their own target.
|
||||
- bug-1893 (found in 2.1): `vget()` returns 0 on success, so today's shared-reason loop (`rc <= 0` skip) records NO shared reason at all. The runner must skip only on `rc < 0`. Characterization fixtures record "no shared reason today" in a separate `_today` test that 4.1/4.2 rewrite.
|
||||
- `xce_sched_core_fini()` does not free the string table `xce_sched_core_init()` creates; leak-checked test targets call `xstring_table_fini()` in teardown (see `test_alloc_equivalence_seqjob.c`).
|
||||
- `test_alloc_equivalence_seqjob.c` is at ~794/800 lines: 4.2's new fixtures go in a second file or after trimming.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue