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


##########
pkg/cache/context_test.go:
##########
@@ -569,33 +543,28 @@ func TestAddUpdatePodForeign(t *testing.T) {
                                })
                        }
                }
-               return validatorFunc(request)
+               return nil
        })
 
-       host1 := nodeForTest(Host1, "10G", "10")
+       host1 := nodeForTest(Host1, "10G", "10") // add existing foreign pod
        context.updateNode(nil, host1)
 
        // pod is not assigned to any node
        pod1 := foreignPod(podName1, "1G", "500m")
        pod1.Status.Phase = v1.PodPending
        pod1.Spec.NodeName = ""
 
-       // validate add
-       tc = "add-pod1"
-       executed = false
-       expectAdd = false
-       expectRemove = false
+       // validate add (pending, no node assigned)
+       allocRequest = nil
        context.AddPod(pod1)
-       assert.Assert(t, !executed, "unexpected update")
+       assert.Assert(t, allocRequest == nil, "unexpected update")
        pod := context.schedulerCache.GetPod(string(pod1.UID))
        assert.Assert(t, pod == nil, "unassigned pod found in cache")
 
-       // validate update
-       tc = "update-pod1"
-       executed = false
-       expectRemove = false
+       // validate update (no change)
+       allocRequest = nil
        context.UpdatePod(nil, pod1)
-       assert.Assert(t, !executed, "unexpected update")
+       assert.Assert(t, allocRequest == nil, "unexpected update")
        assert.Assert(t, pod == nil, "unassigned pod found in cache")

Review Comment:
   Done



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