chenyulin0719 commented on code in PR #918:
URL: https://github.com/apache/yunikorn-k8shim/pull/918#discussion_r1800458143


##########
pkg/cache/context_test.go:
##########
@@ -2004,20 +1923,11 @@ func TestInitializeState(t *testing.T) {
        assert.Equal(t, *pc.PreemptionPolicy, policy, "wrong preemption policy")
        assert.Equal(t, pc.Annotations[constants.AnnotationAllowPreemption], 
constants.True, "wrong allow-preemption value")
 
-       // verify occupied / capacity on node
-       capacity, occupied, ok := 
context.schedulerCache.SnapshotResources(nodeName1)
-       assert.Assert(t, ok, "Unable to retrieve node resources")
-       expectedCapacity := common.ParseResource("4", "10G")
-       assert.Equal(t, expectedCapacity.Resources["vcore"].Value, 
capacity.Resources["vcore"].Value, "wrong capacity vcore")
-       assert.Equal(t, expectedCapacity.Resources["memory"].Value, 
capacity.Resources["memory"].Value, "wrong capacity memory")
-       expectedOccupied := common.ParseResource("1500m", "2G")
-       assert.Equal(t, expectedOccupied.Resources["vcore"].Value, 
occupied.Resources["vcore"].Value, "wrong occupied vcore")
-       assert.Equal(t, expectedOccupied.Resources["memory"].Value, 
occupied.Resources["memory"].Value, "wrong occupied memory")
-

Review Comment:
   If we remove `foreignRunning` / `foreignPending`, which are created in lines 
1856-1865, the test still pass.
   Both pods are not added to cache and I think we should assert that behavior. 
Otherwise, we could remove both of them.
   



-- 
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