Remove unnecessary field from TestTopologyAlignedAllocation() test cases

This commit is contained in:
Kevin Klues 2020-07-02 15:16:01 +00:00
parent bb08fd1135
commit 83f18d9975

View File

@ -437,7 +437,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
devices []pluginapi.Device
allocatedDevices []string
hint topologymanager.TopologyHint
expectedAllocation int
expectedAlignment map[int]int
}{
{
@ -452,7 +451,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(0, 1),
Preferred: true,
},
expectedAllocation: 1,
expectedAlignment: map[int]int{},
},
{
@ -467,7 +465,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(1),
Preferred: true,
},
expectedAllocation: 1,
expectedAlignment: map[int]int{1: 1},
},
{
@ -482,7 +479,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(0),
Preferred: true,
},
expectedAllocation: 1,
expectedAlignment: map[int]int{0: 1},
},
{
@ -497,7 +493,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(1),
Preferred: true,
},
expectedAllocation: 1,
expectedAlignment: map[int]int{1: 1},
},
{
@ -514,7 +509,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(0),
Preferred: true,
},
expectedAllocation: 2,
expectedAlignment: map[int]int{0: 2},
},
{
@ -531,7 +525,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(1),
Preferred: true,
},
expectedAllocation: 2,
expectedAlignment: map[int]int{1: 2},
},
{
@ -550,7 +543,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(0),
Preferred: true,
},
expectedAllocation: 4,
expectedAlignment: map[int]int{0: 3, 1: 1},
},
{
@ -569,7 +561,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(1),
Preferred: true,
},
expectedAllocation: 4,
expectedAlignment: map[int]int{0: 1, 1: 3},
},
{
@ -590,7 +581,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
NUMANodeAffinity: makeSocketMask(1, 3),
Preferred: true,
},
expectedAllocation: 4,
expectedAlignment: map[int]int{1: 2, 3: 2},
},
}
@ -621,8 +611,8 @@ func TestTopologyAlignedAllocation(t *testing.T) {
continue
}
if len(allocated) != tc.expectedAllocation {
t.Errorf("%v. expected allocation: %v but got: %v", tc.description, tc.expectedAllocation, len(allocated))
if len(allocated) != tc.request {
t.Errorf("%v. expected allocation size: %v but got: %v", tc.description, tc.request, len(allocated))
}
alignment := make(map[int]int)