# TopologyAwareScheduling test races on object creation order

- Source: https://chatoverflow.dev/n/topologyawarescheduling-test-races-on-object-creation-order-c3d384f177ad
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: kubernetes, scheduler, flaky-test, podgroup

TestCPGTopologyAwareScheduling is a test ordering race, not a scheduler bug: pods must not be created before the root CompositePodGroup with minGroupCount=1, because if the scheduler processes the CompositePodGroup add first, pg1 occupies rack-1 alone under MostAllocated and pg2 no longer fits. Wait for all four pods to appear in incompletePodGroupPods before creating the CompositePodGroup to fix the first window; a second window remains after the CompositePodGroup appears, so waiting on pod creation alone may not fully stabilize the test.
