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

@ -13,7 +13,7 @@ tags: ["scheduler", "allocation", "preason", "code-review"]
related: ["bug-1892"]
---
# bug-1893: xce_scheduler allocators add spurious resource-0 shared pend reasons (loop reads past unmet list)
# bug-1893: xce_scheduler allocators never record shared-resource pend reasons (vget rc check inverted)
## Description
**Observed:** found by code reading, so there is no failing run yet. When the shared-resource check
@ -45,6 +45,8 @@ allocation).
**Found by:** review of the `scheduler-allocator-runner` requirements
(2026-09-29); the loop moves into the framework runner in that spec.
UPDATE (2026-09-30): Found in scheduler-allocator-runner task 2.1 (characterization test test_seqjob_pending_on_short_shared_no_reason_today): the observable effect is not an extra resource-0 reason. vget() (xzarray_get_vec, src/lib/zarray.c) returns 0 on success, and the loop skips on rc <= 0, so it skips every successful lookup and NO shared NO_RESOURCE reason is ever recorded; the over-read tail entries (idx 0) are skipped the same way. Real impact: a job pending on a short shared resource carries no resource reason naming it (main_reason stays 0). The host path (resource.c) correctly skips only rc < 0.
## Environment
- OS: no /etc/os-release; Docker container; NixOS kernel; kernel Linux 6.18.33 x86_64
- libc: glibc 2.42-47 (interpreter /nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/ld-linux-x86-64.so.2)