Skip to content

Commit

Permalink
Merge pull request kubernetes#93516 from soulxu/fix_node_tree_test
Browse files Browse the repository at this point in the history
Create new slice to avoid modify original fake data
  • Loading branch information
k8s-ci-robot authored Aug 2, 2020
2 parents 09d6512 + 33a7e94 commit c1b772f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/scheduler/internal/cache/node_tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,14 @@ func TestNodeTreeMultiOperations(t *testing.T) {
},
{
name: "add more nodes to an exhausted zone",
nodesToAdd: append(allNodes[4:9], allNodes[3]),
nodesToAdd: append(allNodes[4:9:9], allNodes[3]),
nodesToRemove: nil,
operations: []string{"add", "add", "add", "add", "add", "next", "next", "next", "next", "add", "next", "next", "next"},
expectedOutput: []string{"node-4", "node-6", "node-7", "node-8", "node-3", "node-4", "node-6"},
expectedOutput: []string{"node-4", "node-5", "node-6", "node-7", "node-3", "node-8", "node-4"},
},
{
name: "remove zone and add new to ensure exhausted is reset correctly",
nodesToAdd: append(allNodes[3:5], allNodes[6:8]...),
nodesToAdd: append(allNodes[3:5:5], allNodes[6:8]...),
nodesToRemove: allNodes[3:5],
operations: []string{"add", "add", "next", "next", "remove", "add", "add", "next", "next", "remove", "next", "next"},
expectedOutput: []string{"node-3", "node-4", "node-6", "node-7", "node-6", "node-7"},
Expand Down

0 comments on commit c1b772f

Please sign in to comment.