tigerquoll opened a new pull request, #1131:
URL: https://github.com/apache/yunikorn-core/pull/1131

   ### What this is
   
   A property fuzzer for the core's partition-level accounting. The shim cache 
property fuzzer 
([YUNIKORN-3373](https://issues.apache.org/jira/browse/YUNIKORN-3373)) guards 
shim bookkeeping; nothing guarded the core's. This is the structural guard for 
that class from the core side.
   
   JIRA: [YUNIKORN-3384](https://issues.apache.org/jira/browse/YUNIKORN-3384)
   
   ### Design
   
   Seeded, weighted random operation sequences against a real 
`PartitionContext` with a small queue hierarchy, driven through the same entry 
points the RM uses: add/remove node (removal with live allocations included), 
add/remove app, add ask (regular and required-node), regular and reserved 
scheduling cycles, and allocation release with each termination type. 
Placeholders and the replacement flow are out of scope.
   
   After every operation it checks:
   
   - **Q1** each queue's allocated == sum of its children (recursive)
   - **Q2** each leaf queue's allocated == sum of its apps' allocated
   - **Q3** usage never negative, never over a set maximum
   - **Q4** user/group tracked usage == sum of owned apps' allocated
   - **Q5** each node's allocated == sum of allocations on it
   - **Q6** queue pending == sum of app pending asks
   - **R1** every reservation references a live app + ask + node (both ends)
   
   plus a running allocated-minus-released model cross-check. A failure reports 
the seed, step, and last operations for replay; the run logs its coverage so a 
fuzzer that stops exercising the interesting paths is visible.
   
   ### Verification
   
   Green on master across all seeds — this is a guard, not necessarily a 
finder. Its teeth are proven by mutation testing: five deliberate accounting 
breaks each fire the expected invariant (e.g. dropping `DecAllocatedResource` 
fires Q2/Q3/model; dropping the parent recursion fires Q1; breaking the user 
tracker fires Q4). All mutations reverted — the committed diff is test-only. 
Runtime ~4s.
   
   Two real core defects were found while developing this and are filed 
separately: 
[YUNIKORN-3379](https://issues.apache.org/jira/browse/YUNIKORN-3379) and 
[YUNIKORN-3380](https://issues.apache.org/jira/browse/YUNIKORN-3380). Their 
trigger operations are deliberately excluded so this fuzzer stays green and 
mergeable; a follow-up can add them once the bugs are fixed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to