-
Notifications
You must be signed in to change notification settings - Fork 105
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
OCPBUGS-44372: PPC: skip comparing ProcessorCore.Index between NUMA cores #1213
base: master
Are you sure you want to change the base?
Conversation
ProcessorCore.Index indicates the zero-based index of the core in the Cores slice. While core might be shown in a different order, they can still be equivalent. See: jaypipes/ghw#346. Adjust the equality check to skip this field to fix this: ``` Error: targeted nodes differ: nodes host1.development.lab and host2.development.lab have different topology: the CPU cores differ: processor core openshift#20 (2 threads), logical processors [2 66] vs processor core openshift#20 (2 threads), logical processors [2 66] ``` And add a unit test to cover this scenario. Signed-off-by: Shereen Haj <[email protected]>
@shajmakh: This pull request references Jira Issue OCPBUGS-44372, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/cherry-pick release-4.17 release-4.16 release-4.15 release-4.14 release-4.13 release-4.12 |
@shajmakh: once the present PR merges, I will cherry-pick it on top of In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
LGTM once inline comments are addressed
topology2.Nodes[0].Cores[0].Index = 1 | ||
topology2.Nodes[0].Cores[1].Index = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please deepcopy/clone the topology before to change it to avoid polluting the global state to other test cases
"github.com/jaypipes/ghw/pkg/topology" | ||
) | ||
|
||
func TestSortTopology(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to extract the sortTopology
helper (and test a private function :\ )? Can we test the public SortedTopology()
public function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the intention is to verify sorting is done properly which is the part that was exported as a private function. To test SOrtedTopology() wee need to initialize a handler object to be able to call it, and in this function ultimately fetch the nodes' topologies and perform the actual sorting on that. Thus I don't see the value of testing the SortedTopology. I agree however this was better moved to the existing test file as testing the other private functions (like ensureSameTopology).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note however this is an additional commit that doesn't relate to the bug fix so I believe it is better split to another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow-up PR: #1217
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ffromani, shajmakh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/jira refresh |
@shajmakh: This pull request references Jira Issue OCPBUGS-44372, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Rename test variables and add clarifying comments to avoid misusing them while writing tests. Signed-off-by: Shereen Haj <[email protected]>
a9abb69
to
74b81bd
Compare
@shajmakh: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
ProcessorCore.Index indicates the zero-based index of the core in the
Cores slice. While core might be shown in a different order, they can still
be equivalent. See: jaypipes/ghw#346.
Adjust the equality check to skip this field to fix this:
And add a unit test to cover this scenario and the sortTopology function.
Signed-off-by: Shereen Haj [email protected]