Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.12] OCPBUGS-5531: Skip offline multiple ranges test if number of cores less than 20 #543

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1018,7 +1018,6 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance
}
}
isolatedCpus := strings.Join(isolated, ",")

// Create new performance with offlined
reservedSet := performancev2.CPUSet(reservedCpus)
isolatedSet := performancev2.CPUSet(isolatedCpus)
Expand Down Expand Up @@ -1052,7 +1051,6 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance
Expect(offlinedCPUSet.Equals(offlinedCPUSetProfile))
}
})

It("[test_id:50966]verify offlined parameter accepts multiple ranges of cpuid's", func() {
var reserved, isolated, offlined []string
//This map is of the form numaNode[core][cpu-siblings]
Expand Down Expand Up @@ -1093,9 +1091,11 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance
cores = append(cores, k)
}
sort.Ints(cores)
middleCoreIds := cores[len(cores)/2]
for i := middleCoreIds; i < middleCoreIds+10; i++ {
siblings := nodes.GetCpuSiblings(numaCoreSiblings, i)
if len(cores) < 20 {
Skip(fmt.Sprintf("This test needs systems with at least 20 cores per socket"))
}
for i := 0; i < len(cores)/2; i++ {
siblings := nodes.GetCpuSiblings(numaCoreSiblings, cores[i])
offlined = append(offlined, siblings...)
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/performanceprofile/functests/utils/nodes/nodes.go
Expand Up @@ -434,7 +434,7 @@ func GetCpuSiblings(numaCoreSiblings map[int]map[int][]int, coreKey int) []strin
for key := range numaCoreSiblings {
for _, c := range numaCoreSiblings[key][coreKey] {
cpuSiblings = append(cpuSiblings, strconv.Itoa(c))
delete(numaCoreSiblings[key], c)
delete(numaCoreSiblings[key], coreKey)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh? I can't quite understand this change. You are deleting the very item you iterate over.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numacoresiblings map is of [numa-Node][core][siblings]

The reason is we are using the same map to get reserved , isolated and offline cpus . So once we use cpus for lets say reserved, we delete the core id's from which we picked the siblings so that when we use the map for lets say offline cpus, we want to iterate with what is left so that reserved, offline don't end having same cpu siblings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why do you iterate over for _, c := range numaCoreSiblings[key][coreKey] then? You only do one loop and then delete the whole core.

Shouldn't the delete be ouside of the loop?

}
}
return cpuSiblings
Expand Down