PoiBlackTea commented on PR #1108: URL: https://github.com/apache/yunikorn-core/pull/1108#issuecomment-5120584607
You're correct, only `overflowVictims` and `shortfallVictims` need distinct variables, since they are the only inputs shared across multiple subtests. Root cause: `preemptVictims()` calls `victim.MarkPreempted()` which sets `preempted = true` on the `*Allocation` pointer, then sends the event to the Event System's channel (`ec.channel <- event`) for background goroutine processing. Since both subtests reference the same heap pointer, the next subtest's `filterAllocations()` hits `alloc.IsPreempted() == true` at [quota_preemptor.go#L285](https://github.com/apache/yunikorn-core/blob/master/pkg/scheduler/objects/quota_preemptor.go#L285) and skips the allocation, producing wrong victim counts. This is easily reproducible by simply removing the `time.Sleep(500 * time.Millisecond)` . -- 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]
