mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
Remove unnecessary field from TestTopologyAlignedAllocation() test cases
This commit is contained in:
parent
bb08fd1135
commit
83f18d9975
@ -437,7 +437,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
devices []pluginapi.Device
|
devices []pluginapi.Device
|
||||||
allocatedDevices []string
|
allocatedDevices []string
|
||||||
hint topologymanager.TopologyHint
|
hint topologymanager.TopologyHint
|
||||||
expectedAllocation int
|
|
||||||
expectedAlignment map[int]int
|
expectedAlignment map[int]int
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
@ -452,7 +451,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(0, 1),
|
NUMANodeAffinity: makeSocketMask(0, 1),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 1,
|
|
||||||
expectedAlignment: map[int]int{},
|
expectedAlignment: map[int]int{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -467,7 +465,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(1),
|
NUMANodeAffinity: makeSocketMask(1),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 1,
|
|
||||||
expectedAlignment: map[int]int{1: 1},
|
expectedAlignment: map[int]int{1: 1},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -482,7 +479,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(0),
|
NUMANodeAffinity: makeSocketMask(0),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 1,
|
|
||||||
expectedAlignment: map[int]int{0: 1},
|
expectedAlignment: map[int]int{0: 1},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -497,7 +493,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(1),
|
NUMANodeAffinity: makeSocketMask(1),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 1,
|
|
||||||
expectedAlignment: map[int]int{1: 1},
|
expectedAlignment: map[int]int{1: 1},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -514,7 +509,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(0),
|
NUMANodeAffinity: makeSocketMask(0),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 2,
|
|
||||||
expectedAlignment: map[int]int{0: 2},
|
expectedAlignment: map[int]int{0: 2},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -531,7 +525,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(1),
|
NUMANodeAffinity: makeSocketMask(1),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 2,
|
|
||||||
expectedAlignment: map[int]int{1: 2},
|
expectedAlignment: map[int]int{1: 2},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -550,7 +543,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(0),
|
NUMANodeAffinity: makeSocketMask(0),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 4,
|
|
||||||
expectedAlignment: map[int]int{0: 3, 1: 1},
|
expectedAlignment: map[int]int{0: 3, 1: 1},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -569,7 +561,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(1),
|
NUMANodeAffinity: makeSocketMask(1),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 4,
|
|
||||||
expectedAlignment: map[int]int{0: 1, 1: 3},
|
expectedAlignment: map[int]int{0: 1, 1: 3},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -590,7 +581,6 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
NUMANodeAffinity: makeSocketMask(1, 3),
|
NUMANodeAffinity: makeSocketMask(1, 3),
|
||||||
Preferred: true,
|
Preferred: true,
|
||||||
},
|
},
|
||||||
expectedAllocation: 4,
|
|
||||||
expectedAlignment: map[int]int{1: 2, 3: 2},
|
expectedAlignment: map[int]int{1: 2, 3: 2},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -621,8 +611,8 @@ func TestTopologyAlignedAllocation(t *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(allocated) != tc.expectedAllocation {
|
if len(allocated) != tc.request {
|
||||||
t.Errorf("%v. expected allocation: %v but got: %v", tc.description, tc.expectedAllocation, len(allocated))
|
t.Errorf("%v. expected allocation size: %v but got: %v", tc.description, tc.request, len(allocated))
|
||||||
}
|
}
|
||||||
|
|
||||||
alignment := make(map[int]int)
|
alignment := make(map[int]int)
|
||||||
|
Loading…
Reference in New Issue
Block a user