myxce/src
Rongsong Shen c832706e0c
test(scheduler): fix wrong resInUse precondition in mem-reservation test (bug-1758)
test_job_rusage_reconciles_mem_reservation_against_usage asserted
w->resInUse was already charged 4.0 for a JOBS_PUSH-dispatched RUN job,
immediately after the push with no round boundary simulated. That
assumption was wrong, not the scheduler: resInUse/sharedInUse is never
charged incrementally at JOBS_PUSH/dispatch time. It's fully re-derived
once per round by sched_account_jobs() (scheduler.c), which iterates
every currently-RUN job and calls sched_charge_account() on each one's
accounts -- called by both the real normal-mode driver (driver.c) and
the sim driver (sim_loop.c), always before anything else in that round
reads resInUse. Confirmed by reading the full JOBS_PUSH handler
(core_events.c) and builtin_fcfs_on_job_push(): neither ever charges or
uncharges resInUse, by design -- core_session.c's own doc comment on
core_begin_session_internal() already documents this "recompute from
source of truth each round" architecture.

Fix: the test now calls sched_charge_account(&core, tracked->accounts)
right after JOBS_PUSH, simulating the one round-boundary reconciliation
step sched_account_jobs() would perform for its single RUN job (that
function itself lives in scheduler.c, not white-box #included here, so
its single-job effect is reproduced directly via the same primitive it
calls internally). No production code changed.

Full scheduler suite: 77/77 Ok (was 76/77). Full xce-build.sh all asan
--incremental: 94/94 Ok, zero regressions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GLfB5uWRdmx2WiZSFC7Fm7
2026-09-08 09:16:29 +00:00
..
autoscaler remove extralib 2026-09-04 11:24:43 +08:00
configs fix(scheduler): live-verify bug-1790 with a real global mem limit 2026-09-08 08:49:17 +00:00
controller feat(eliminate-frontend-makefile): task 3.4 - update source code comments 2026-09-03 14:34:48 +00:00
docs feat(eliminate-frontend-makefile): task 3.3 - update live documentation (11 files) 2026-09-03 14:22:54 +00:00
frontend fix(apiserver): fix job control union discriminant, add human-readable job ID support (gitea#45) 2026-09-07 08:31:54 +00:00
include fix(scheduler): populate job-wide total want for per-host resources during global phase (bug-1790) 2026-09-08 02:57:51 +00:00
lib fix(lib): free host_account.host and job_account test fixtures (bug-1723, bug-1621) 2026-09-08 09:16:20 +00:00
nixSupport remove extralib 2026-09-04 11:24:43 +08:00
scheduler test(scheduler): fix wrong resInUse precondition in mem-reservation test (bug-1758) 2026-09-08 09:16:29 +00:00
schema feat(worker-rejoin-resync): task 6.1 - trigger reconciliation on rejoin 2026-09-01 19:43:18 +00:00
tools Merge branch 'better_xce_build' into scheduler-framework 2026-09-08 03:09:53 +00:00
worker fix(worker): real maxswap/maxtmp detection; feat(scheduler): annotate multi-slot assigned jobs 2026-09-07 04:39:22 +00:00
xceadmin build: make Go and Python builds fully offline (hermetic Nix build) 2026-09-03 12:38:49 +08:00
flake.lock remove extralib 2026-09-04 11:24:43 +08:00
flake.nix remove extralib 2026-09-04 11:24:43 +08:00
meson.build feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00
meson.options feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00