test(resreq-maxtasks-wiring): verify ingest wiring parity and no-regression

Adds test_maxtasks_wiring_ingest.c proving: (1) fresh ingest's
dispatched primary resreq reflects a real multi-task job's requested
count via the real core_build_job()/JOBS_PUSH path; (2) fresh ingest
and snapshot-restore ingest derive the identical task count for an
equivalent job, asserted both against expected constants and via
direct cross-comparison (Requirement 5.6); (3) a single-task job
reaches identical real host-selection/allocation behavior through the
live allocator dispatch chain, proving the feature is a true no-op
for maxTasks==1 (Requirements 3.1/3.2). No production code changed --
tasks 2.1/2.2 already wired the fix; this adds cross-call-site and
behavioral proof neither of those isolated tests attempted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYdtrEWWZfKRRGED7raEYg
This commit is contained in:
Rongsong Shen 2026-09-06 06:01:00 +00:00
parent f02bedc52b
commit 4644d20cf0
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
3 changed files with 828 additions and 1 deletions

View file

@ -1928,3 +1928,36 @@ sched_parjob_e2e_multislot_test = executable(
test('scheduler parjob e2e multislot test',
sched_parjob_e2e_multislot_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
# resreq-maxtasks-wiring spec, task 3.1 (Req 1.1, 1.3, 3.1, 3.2, 5.6): the
# dedicated integration test file for this feature's two live ingest call
# sites -- fresh ingest reflects a real multi-task job's requested task
# count (Req 1.1), fresh ingest and snapshot-restore ingest derive the
# IDENTICAL task count for an equivalent job (Req 1.3/5.6's own comparative
# claim), and a single-task job's real host-selection/dispatch outcome is
# unaffected by this feature (Req 3.1/3.2). Same real-scheduler_srcs link
# technique as sched_parjob_e2e_multislot_test/sched_snapshot_load_
# allocator_regression_test above (see this test file's own header comment
# for the full rationale -- one link technique for the whole file avoids a
# duplicate-symbol conflict with meson's own separate compilation of
# core.c/core_events.c/snapshot_load.c below).
sched_maxtasks_wiring_ingest_test_srcs = [
'test_maxtasks_wiring_ingest.c']
foreach f : scheduler_srcs
if f != 'src/main.c'
sched_maxtasks_wiring_ingest_test_srcs += ['../' + f]
endif
endforeach
sched_maxtasks_wiring_ingest_test = executable(
'sched_maxtasks_wiring_ingest_test',
sched_maxtasks_wiring_ingest_test_srcs,
include_directories:[incdir],
dependencies: [scheduler_deps, unity_dep],
link_args: ['-Wl,--wrap=xcecli_start',
'-Wl,--wrap=xcecli_join'],
install: false)
test('scheduler maxtasks wiring ingest test',
sched_maxtasks_wiring_ingest_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])