feat(job-array-single-wal-record): build the compact scheduler push

Adds xcesched_push_jobarray() (sched.c), encoding one compact
(base jobid, array_size, one spec) Data.jobArray descriptor -- reusing
the JobSubmit capnp struct already added to the Data union in task 1.2
-- instead of N individually-encoded job structs. sched_job_new_fun()
branches on l->count > 1 to call it; the existing single-job path
(l->count == 1 -> xcesched_push_joblist()) is byte-for-byte unchanged.

Sends via direct xce_request()/OPCode_push/Request_body_pushmsg rather
than the existing xce_push_data_req() helper, which hard-rejects any
payload outside jobs/workers/resources/resvals and cannot carry a
single non-list descriptor. design.md corrected to record this
transport deviation for task 5.2 to follow.

New standalone sched_push_unit_test binary (registered in
meson.build): sched.c/dataex.c/egress.c were never linked into
controller_unit_test, and two existing test files there ship local
fakes of on_scheduler_join()/notify()/collect_confvars() that would
collide with the real definitions at link time.

Task 5.1 of job-array-single-wal-record (Requirements 6.1, 6.3, 6.4).
This commit is contained in:
Rongsong Shen 2026-07-15 08:03:04 +00:00
parent 1888498401
commit 5e7a4aa392
5 changed files with 385 additions and 5 deletions

View file

@ -210,3 +210,34 @@ test('controller test', controller_unit_test,
timeout: 300,
env: ['ASAN_OPTIONS=detect_leaks=0'])
# job-array-single-wal-record task 5.1: sched.c's push logic (sched_job_new_fun /
# xcesched_push_jobarray) is exercised by a small, STANDALONE test binary rather
# than being folded into controller_unit_test_src above. sched.c/dataex.c are not
# part of that binary today -- several existing files there (test_commit_barrier_
# reply.c, test_worker_join.c) already provide their OWN local fake definitions
# of on_scheduler_join()/notify()/collect_confvars(), precisely because the real
# sched.c/dataex.c were never linked in. Linking the real ones alongside those
# fakes collides at link time (multiple definition). This binary links the real
# sched.c + its real dataex.c/egress.c dependencies, isolated from that
# collision; only opget.c's one-line check_worker_() is stubbed locally in the
# test file (linking all of opget.c would pull in its own further dependencies
# this test does not need).
sched_push_unit_test_src = [
'testsuite/test_job_array_sched_push.c',
'sched.c',
'dataex.c',
'egress.c',
]
sched_push_unit_test = executable('sched_push_unit_test',
sched_push_unit_test_src,
include_directories: [incdir],
dependencies: controller_unit_test_deps,
c_args: ['-DXCE_TESTING'],
install: false)
test('sched push test', sched_push_unit_test,
suite: 'controller',
timeout: 60,
env: ['ASAN_OPTIONS=detect_leaks=0'])