test(scheduler-sim-live-allocation): prove replay-driven limit visibility (task 5.2, closes bug-1826)

Adds the feature's concrete original acceptance test: a genuine
capnp-encoded .replay (real ReplayHeader/SnapshotEntry/Conf4Sched with
one global and one host-scoped limit), driven end-to-end through the
real, unmodified sched_sim_driver_run(). The dispatched job's usage
registers against both limits via limit_get_configured_limits()/
limit_get_usage_instances() -- the same accessors info limit reads --
proving real, non-zero usage where today's REPL previously showed none.

RED-phase evidence: reverting task 4.3's 4 files to their pre-fix
commit reproduces the exact predicted failure (host-scoped usage
missing, global usage intact); restoring to HEAD reproduces GREEN.

Closes bug-1826 (the bug this whole feature was built to fix) --
buglog entry updated from NOT FIXED to FULLY FIXED, citing this test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
Rongsong Shen 2026-09-19 09:11:40 +00:00
parent ab88848f91
commit a70c7a2c61
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
4 changed files with 5006 additions and 2198 deletions

View file

@ -2191,3 +2191,33 @@ sched_sim_contention_limit_driver_parity_test = executable(
test('scheduler sim contention limit driver parity test',
sched_sim_contention_limit_driver_parity_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
# scheduler-sim-live-allocation spec, task 5.2 (Req 2.1, 2.2, 2.3, 2.4): the
# feature's concrete, original acceptance test (bug-1826) -- a real global
# AND host-scoped limit configured in a real SnapshotEntry's Conf4Sched,
# carried through a real `.replay` file, driven end to end via the real,
# unmodified sched_sim_driver_run() -- confirming `info limit`'s own
# backing accessors (limit_get_configured_limits()/limit_get_usage_
# instances()) show real, non-zero usage for both, where before this
# feature they showed none for either. Same real-scheduler_srcs link
# technique as sched_sim_live_allocation_test/sched_sim_alloc_limit_fanout_
# test/sched_sim_contention_limit_driver_parity_test above.
sched_sim_e2e_limit_visibility_test_srcs = [
'test_sim_e2e_limit_visibility.c'
]
foreach f : scheduler_srcs
if f != 'src/main.c'
sched_sim_e2e_limit_visibility_test_srcs += ['../' + f]
endif
endforeach
sched_sim_e2e_limit_visibility_test = executable(
'sched_sim_e2e_limit_visibility_test',
sched_sim_e2e_limit_visibility_test_srcs,
include_directories:[incdir],
dependencies: [scheduler_test_deps],
install: false)
test('scheduler sim e2e limit visibility test',
sched_sim_e2e_limit_visibility_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])