test(scheduler-allocation): prove parjob's shared resource commits once

Task 4.3's multi-host merge itself was already implemented and verified
by task 4.2. The one unproven clause -- job-level shared-resource
allocation computed once regardless of host count -- is now covered by
test_shared_resource_debited_once_regardless_of_host_count, using a
PER_JOB (not PER_TASK) global resource so a per-bucket-repeated
computation can't coincidentally sum to the correct total. Mutation
testing (a deliberately injected duplicate per-host shared debit)
confirms the test fails exactly as expected; production code required
no change.

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-04 21:53:12 +00:00
parent 3d5e1c32c0
commit 9d23060b76
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
2 changed files with 173 additions and 1 deletions

View file

@ -66,7 +66,7 @@
- Observable: a passing test suite covers multi-bucket success, the descending-vs-ascending worked example, and partial-failure-then-reversal
- _Requirements: 4.2, 4.4, 4.5, 4.6, 4.7_
- _Depends: 3.1_
- [ ] 4.3 Implement parjob's multi-host allocation commit
- [x] 4.3 Implement parjob's multi-host allocation commit
- Merge every claimed bucket's host allocation into a single job allocation record spanning all claimed hosts, leaving job-level shared-resource allocation computed once and unaffected by how many hosts were used
- Observable: a successfully allocated multi-host job's allocation record correctly lists every claimed host with its own slot count
- _Requirements: 4.3_