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:
Rongsong Shen 2026-09-30 08:11:26 +00:00
parent 31ad79d325
commit 91a8580948
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
8 changed files with 835 additions and 16 deletions

View file

@ -1714,6 +1714,21 @@ sched_seqjob_allocator_test = executable(
dependencies: [scheduler_test_deps],
install: false)
# scheduler-allocator-runner task 2.1 (Req 4.5, 5.4, 5.8, 7.2): seqjob
# characterization through the plugin's registered job_alloc_fn, against
# today's allocator and (from task 4.2) the framework runner. Same white-box
# stack as sched_seqjob_allocator_test. `--wrap` on libxce's
# make_host_alloc/make_job_alloc gives the test fail-on-call-N out-of-memory
# injection points that stay the same across the switch.
sched_alloc_equivalence_seqjob_test = executable(
'sched_alloc_equivalence_seqjob_test',
['test_alloc_equivalence_seqjob.c'],
include_directories:[incdir],
dependencies: [scheduler_test_deps],
link_args: ['-Wl,--wrap=make_host_alloc',
'-Wl,--wrap=make_job_alloc'],
install: false)
# Task 3.2 (scheduler-allocation spec, Req 9.1): the dedicated pre/post-
# rewrap host-selection EQUIVALENCE proof for seqjob_allocator.c's
# my_alloc() -- fixture states task 3.1's own smoke test does not cover
@ -1980,6 +1995,9 @@ test('scheduler sim cache clear isolation test',
test('scheduler seqjob allocator test',
sched_seqjob_allocator_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
# Leak detection stays on: every fixture tears down its ctx, core and plugin.
test('scheduler alloc equivalence seqjob test',
sched_alloc_equivalence_seqjob_test, suite: 'scheduler')
test('scheduler seqjob rewrap equivalence test',
sched_seqjob_rewrap_equivalence_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])