Skip to content

Commit

Permalink
[YUNIKORN-1855] Fix scheduler cache unit test comments (#630)
Browse files Browse the repository at this point in the history
Closes: #630

Signed-off-by: Craig Condit <ccondit@apache.org>
  • Loading branch information
FrankYang0529 authored and craigcondit committed Jul 11, 2023
1 parent 7e63075 commit 9d1158a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/cache/external/scheduler_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestAssignedPod(t *testing.T) {

// verify the node is added to cache
// the cached node has reference to the v1.Node object
// the cached node has no pods assigned
// the cached node has one pod assigned
cachedNode := cache.GetNode(node.Name)
assert.Check(t, cachedNode != nil, "host0001 is not found in cache")
assert.Check(t, cachedNode.Node() != nil, "host0001 exists in cache but the ref to v1.Node doesn't exist")
Expand Down Expand Up @@ -651,11 +651,10 @@ func TestAddPod(t *testing.T) {
assert.Equal(t, len(cache.podsMap), 1, "wrong pod count after re-add of pod1")
assert.Check(t, ok, "pod1 not found")

// assumed pod should no longer be assumed if node changes
// assumed pod with node should still be assumed if re-add
pod1Copy := pod1.DeepCopy()
pod1Copy.Spec.NodeName = "test-node-add"
cache.AssumePod(pod1Copy, true)

assert.Check(t, cache.isAssumedPod(podUID1), "pod is not assumed")
cache.AddPod(pod1)
assert.Check(t, cache.isAssumedPod(podUID1), "pod is not assumed after re-add")
Expand Down

0 comments on commit 9d1158a

Please sign in to comment.