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

Fix topology hints test #107548

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

lzhecheng
Copy link
Contributor

@lzhecheng lzhecheng commented Jan 14, 2022

  • It should check one Node in a zone instead of each Node and its fromZone.
  • Check Nodes' CPUs if they are equivalen

Signed-off-by: Zhecheng Li zhechengli@microsoft.com

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 14, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @lzhecheng!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 14, 2022
@k8s-ci-robot
Copy link
Contributor

@lzhecheng: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

Hi @lzhecheng. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 14, 2022
@k8s-ci-robot k8s-ci-robot added area/test sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 14, 2022
@@ -153,7 +153,7 @@ var _ = common.SIGDescribe("Feature:Topology Hints", func() {
framework.Failf("Expected zone to be specified for %s node", nodeName)
}
ginkgo.By("creating a client pod for probing the service from " + fromZone)
podName := "curl-from-" + fromZone
podName := fmt.Sprintf("client%d-curl-from-%s", i, fromZone)
Copy link
Member

Choose a reason for hiding this comment

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

I think that we leaked the environment assumptions into the test, this is an example of an execution.

[BeforeEach] [sig-network] Feature:Topology Hints
  /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/network/topology_hints.go:47
[It] should distribute endpoints evenly
  /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/network/topology_hints.go:52
Jan 14 06:43:17.801: INFO: DaemonSet pods can't tolerate node kind-control-plane with taints [{Key:node-role.kubernetes.io/master Value: Effect:NoSchedule TimeAdded:<nil>}], skip checking this node
Jan 14 06:43:17.808: INFO: Number of nodes with available pods controlled by daemonset topology-serve-hostname: 0
Jan 14 06:43:17.808: INFO: Node kind-worker is running 0 daemon pod, expected 1
Jan 14 06:43:22.799: INFO: DaemonSet pods can't tolerate node kind-control-plane with taints [{Key:node-role.kubernetes.io/master Value: Effect:NoSchedule TimeAdded:<nil>}], skip checking this node
Jan 14 06:43:22.803: INFO: Number of nodes with available pods controlled by daemonset topology-serve-hostname: 3
Jan 14 06:43:22.803: INFO: Number of running nodes: 3, number of available pods: 3 in daemonset topology-serve-hostname
Jan 14 06:43:22.808: INFO: DaemonSet pods can't tolerate node kind-control-plane with taints [{Key:node-role.kubernetes.io/master Value: Effect:NoSchedule TimeAdded:<nil>}], skip checking this node
Jan 14 06:43:22.808: INFO: Waiting for 3 endpoints to be tracked in EndpointSlices
�[1mSTEP�[0m: having hints set for each endpoint
�[1mSTEP�[0m: keeping requests in the same zone
�[1mSTEP�[0m: creating a client pod for probing the service from zone-a
Jan 14 06:43:27.830: INFO: The status of Pod curl-from-zone-a is Pending, waiting for it to be Running (with Ready = true)
Jan 14 06:43:29.834: INFO: The status of Pod curl-from-zone-a is Pending, waiting for it to be Running (with Ready = true)
Jan 14 06:43:31.835: INFO: The status of Pod curl-from-zone-a is Running (Ready = true)
Jan 14 06:43:31.837: INFO: Ensuring that requests from curl-from-zone-a pod on kind-worker node stay in zone-a zone
Jan 14 06:43:36.850: INFO: Pod client logs: Fri Jan 14 06:43:29 UTC 2022
Date: Fri Jan 14 06:43:30 UTC 2022 Try: 1
topology-serve-hostname-cvlkk
Date: Fri Jan 14 06:43:31 UTC 2022 Try: 2
topology-serve-hostname-cvlkk
Date: Fri Jan 14 06:43:32 UTC 2022 Try: 3
topology-serve-hostname-cvlkk
Date: Fri Jan 14 06:43:33 UTC 2022 Try: 4
topology-serve-hostname-cvlkk
Date: Fri Jan 14 06:43:34 UTC 2022 Try: 5
topology-serve-hostname-cvlkk
Date: Fri Jan 14 06:43:35 UTC 2022 Try: 6
topology-serve-hostname-cvlkk
Date: Fri Jan 14 06:43:36 UTC 2022 Try: 7
topology-serve-hostname-cvlkk

�[1mSTEP�[0m: creating a client pod for probing the service from zone-b
Jan 14 06:43:36.858: INFO: The status of Pod curl-from-zone-b is Pending, waiting for it to be Running (with Ready = true)
Jan 14 06:43:38.866: INFO: The status of Pod curl-from-zone-b is Pending, waiting for it to be Running (with Ready = true)
Jan 14 06:43:40.863: INFO: The status of Pod curl-from-zone-b is Running (Ready = true)
Jan 14 06:43:40.866: INFO: Ensuring that requests from curl-from-zone-b pod on kind-worker2 node stay in zone-b zone
Jan 14 06:43:45.873: INFO: Pod client logs: Fri Jan 14 06:43:38 UTC 2022
Date: Fri Jan 14 06:43:39 UTC 2022 Try: 1
topology-serve-hostname-fx8kl
Date: Fri Jan 14 06:43:40 UTC 2022 Try: 2
topology-serve-hostname-fx8kl
Date: Fri Jan 14 06:43:41 UTC 2022 Try: 3
topology-serve-hostname-fx8kl
Date: Fri Jan 14 06:43:42 UTC 2022 Try: 4
topology-serve-hostname-fx8kl
Date: Fri Jan 14 06:43:43 UTC 2022 Try: 5
topology-serve-hostname-fx8kl
Date: Fri Jan 14 06:43:44 UTC 2022 Try: 6
topology-serve-hostname-fx8kl
Date: Fri Jan 14 06:43:45 UTC 2022 Try: 7
topology-serve-hostname-fx8kl

�[1mSTEP�[0m: creating a client pod for probing the service from zone-c
Jan 14 06:43:45.882: INFO: The status of Pod curl-from-zone-c is Pending, waiting for it to be Running (with Ready = true)
Jan 14 06:43:47.888: INFO: The status of Pod curl-from-zone-c is Pending, waiting for it to be Running (with Ready = true)
Jan 14 06:43:49.886: INFO: The status of Pod curl-from-zone-c is Pending, waiting for it to be Running (with Ready = true)
Jan 14 06:43:51.887: INFO: The status of Pod curl-from-zone-c is Pending, waiting for it to be Running (with Ready = true)
Jan 14 06:43:53.886: INFO: The status of Pod curl-from-zone-c is Running (Ready = true)
Jan 14 06:43:53.892: INFO: Ensuring that requests from curl-from-zone-c pod on kind-worker3 node stay in zone-c zone
Jan 14 06:43:58.900: INFO: Pod client logs: Fri Jan 14 06:43:46 UTC 2022
Date: Fri Jan 14 06:43:47 UTC 2022 Try: 1

If I recall correctly this loop has to iterate for one node of each zone, so it checks that for all existing zones in the cluster, the traffic remains in the zone.

Based on that, the name is correct, what is not correct is the loop, that instead of iterating over the nodeNames and break at 3, it has to iterate over the zones and pick one node of each zone, this will guarantee that the pods names are unique too

Let's wait for @robscott for confirmation

Copy link
Member

@robscott robscott Jan 14, 2022

Choose a reason for hiding this comment

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

Yep, this test assumes a variety of things about the cluster it is running in. It would make sense to update this test to support more flexible deployments and bail out/error if it is in an unsupported one.

For reference, this test currently assumes the following:

  1. All nodes have equivalent allocatable CPU
  2. There are 3 nodes, each in a different zone
  3. The TopologyAwareHints feature gate is enabled

I don't think we have a way to verify 3, but we could add a check for 1, and refactor the test to work if the number of nodes/zones is different. We still would need nodes to exist in more than one zone for this test to work though.

Copy link
Contributor Author

@lzhecheng lzhecheng Jan 17, 2022

Choose a reason for hiding this comment

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

@aojea @robscott thank you for your suggestions and I have updated the code. PTAL.

Copy link
Member

Choose a reason for hiding this comment

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

don't add new helper functions, until we have clear we can't reuse them I prefer to keep that code within the test.
Another thing is that you can do a List instead of a Get per node, it is going to be more efficiente and reduce flakiness

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Code is updated.

@aojea
Copy link
Member

aojea commented Jan 14, 2022

/ok-to-test
/kind bug
/assign @robscott @aojea

@lzhecheng I think we don't need a release not for this change, but let's wait for Rob to reply to my comment

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. kind/bug Categorizes issue or PR as related to a bug. labels Jan 14, 2022
@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jan 14, 2022
@lzhecheng
Copy link
Contributor Author

@aojea sounds reasonable. Thanks!

@aojea
Copy link
Member

aojea commented Jan 14, 2022

/release-note-none

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Jan 14, 2022
}
nodeCPU, found := node.Status.Allocatable[v1.ResourceCPU]
if !found {
framework.Failf("Error when getting allocatable CPU of Node '%s'", node.Name)
Copy link
Member

Choose a reason for hiding this comment

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

@robscott fail or skip?

Copy link
Member

Choose a reason for hiding this comment

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

Fail seems appropriate. If the test has not been skipped already, we're likely intentionally trying to run it, so failing will likely provide more noticeable/meaningful output.

@aojea
Copy link
Member

aojea commented Jan 18, 2022

/test

@k8s-ci-robot
Copy link
Contributor

@aojea: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

  • /test pull-kubernetes-conformance-kind-ga-only-parallel
  • /test pull-kubernetes-dependencies
  • /test pull-kubernetes-dependencies-go-canary
  • /test pull-kubernetes-e2e-gce
  • /test pull-kubernetes-e2e-gce-100-performance
  • /test pull-kubernetes-e2e-gce-big-performance
  • /test pull-kubernetes-e2e-gce-canary
  • /test pull-kubernetes-e2e-gce-large-performance
  • /test pull-kubernetes-e2e-gce-network-proxy-http-connect
  • /test pull-kubernetes-e2e-gce-no-stage
  • /test pull-kubernetes-e2e-gce-ubuntu
  • /test pull-kubernetes-e2e-gce-ubuntu-containerd
  • /test pull-kubernetes-e2e-gce-ubuntu-containerd-canary
  • /test pull-kubernetes-e2e-kind
  • /test pull-kubernetes-e2e-kind-ipv6
  • /test pull-kubernetes-files-remake
  • /test pull-kubernetes-integration
  • /test pull-kubernetes-integration-go-canary
  • /test pull-kubernetes-kubemark-e2e-gce-scale
  • /test pull-kubernetes-node-e2e-containerd
  • /test pull-kubernetes-typecheck
  • /test pull-kubernetes-unit
  • /test pull-kubernetes-unit-go-canary
  • /test pull-kubernetes-verify
  • /test pull-kubernetes-verify-go-canary
  • /test pull-kubernetes-verify-govet-levee

The following commands are available to trigger optional jobs:

  • /test check-dependency-stats
  • /test pull-kubernetes-conformance-image-test
  • /test pull-kubernetes-conformance-kind-ga-only
  • /test pull-kubernetes-conformance-kind-ipv6-parallel
  • /test pull-kubernetes-cross
  • /test pull-kubernetes-e2e-aks-engine-azure-disk-windows-containerd
  • /test pull-kubernetes-e2e-aks-engine-azure-file-windows-containerd
  • /test pull-kubernetes-e2e-aks-engine-gpu-windows-dockershim
  • /test pull-kubernetes-e2e-aks-engine-windows-containerd
  • /test pull-kubernetes-e2e-capz-azure-disk
  • /test pull-kubernetes-e2e-capz-azure-disk-vmss
  • /test pull-kubernetes-e2e-capz-azure-file
  • /test pull-kubernetes-e2e-capz-azure-file-vmss
  • /test pull-kubernetes-e2e-capz-conformance
  • /test pull-kubernetes-e2e-capz-ha-control-plane
  • /test pull-kubernetes-e2e-containerd-gce
  • /test pull-kubernetes-e2e-gce-alpha-features
  • /test pull-kubernetes-e2e-gce-correctness
  • /test pull-kubernetes-e2e-gce-csi-serial
  • /test pull-kubernetes-e2e-gce-device-plugin-gpu
  • /test pull-kubernetes-e2e-gce-iscsi
  • /test pull-kubernetes-e2e-gce-iscsi-serial
  • /test pull-kubernetes-e2e-gce-kubetest2
  • /test pull-kubernetes-e2e-gce-network-proxy-grpc
  • /test pull-kubernetes-e2e-gce-storage-disruptive
  • /test pull-kubernetes-e2e-gce-storage-slow
  • /test pull-kubernetes-e2e-gce-storage-snapshot
  • /test pull-kubernetes-e2e-gci-gce-autoscaling
  • /test pull-kubernetes-e2e-gci-gce-ingress
  • /test pull-kubernetes-e2e-gci-gce-ipvs
  • /test pull-kubernetes-e2e-iptables-azure-dualstack
  • /test pull-kubernetes-e2e-ipvs-azure-dualstack
  • /test pull-kubernetes-e2e-kind-canary
  • /test pull-kubernetes-e2e-kind-dual-canary
  • /test pull-kubernetes-e2e-kind-ipv6-canary
  • /test pull-kubernetes-e2e-kind-ipvs-dual-canary
  • /test pull-kubernetes-e2e-kind-multizone
  • /test pull-kubernetes-e2e-kops-aws
  • /test pull-kubernetes-e2e-ubuntu-gce-network-policies
  • /test pull-kubernetes-e2e-windows-gce
  • /test pull-kubernetes-kubemark-e2e-gce-big
  • /test pull-kubernetes-local-e2e
  • /test pull-kubernetes-node-crio-cgrpv2-e2e
  • /test pull-kubernetes-node-crio-cgrpv2-e2e-kubetest2
  • /test pull-kubernetes-node-crio-e2e
  • /test pull-kubernetes-node-crio-e2e-kubetest2
  • /test pull-kubernetes-node-e2e
  • /test pull-kubernetes-node-e2e-alpha
  • /test pull-kubernetes-node-e2e-alpha-kubetest2
  • /test pull-kubernetes-node-e2e-containerd-features
  • /test pull-kubernetes-node-e2e-containerd-features-kubetest2
  • /test pull-kubernetes-node-e2e-containerd-kubetest2
  • /test pull-kubernetes-node-e2e-kubetest2
  • /test pull-kubernetes-node-e2e-podutil
  • /test pull-kubernetes-node-kubelet-eviction
  • /test pull-kubernetes-node-kubelet-eviction-kubetest2
  • /test pull-kubernetes-node-kubelet-serial
  • /test pull-kubernetes-node-kubelet-serial-containerd
  • /test pull-kubernetes-node-kubelet-serial-containerd-kubetest2
  • /test pull-kubernetes-node-kubelet-serial-cpu-manager
  • /test pull-kubernetes-node-kubelet-serial-cpu-manager-kubetest2
  • /test pull-kubernetes-node-kubelet-serial-crio-cgroupv1
  • /test pull-kubernetes-node-kubelet-serial-crio-cgroupv2
  • /test pull-kubernetes-node-kubelet-serial-hugepages
  • /test pull-kubernetes-node-kubelet-serial-kubetest2
  • /test pull-kubernetes-node-kubelet-serial-memory-manager
  • /test pull-kubernetes-node-kubelet-serial-topology-manager
  • /test pull-kubernetes-node-kubelet-serial-topology-manager-kubetest2
  • /test pull-kubernetes-node-memoryqos-cgrpv2
  • /test pull-kubernetes-node-swap-fedora
  • /test pull-kubernetes-node-swap-ubuntu
  • /test pull-kubernetes-unit-experimental
  • /test pull-publishing-bot-validate

Use /test all to run the following jobs that were automatically triggered:

  • pull-kubernetes-conformance-kind-ga-only-parallel
  • pull-kubernetes-conformance-kind-ipv6-parallel
  • pull-kubernetes-dependencies
  • pull-kubernetes-e2e-gce-100-performance
  • pull-kubernetes-e2e-gce-ubuntu-containerd
  • pull-kubernetes-e2e-gci-gce-ingress
  • pull-kubernetes-e2e-gci-gce-ipvs
  • pull-kubernetes-e2e-kind
  • pull-kubernetes-e2e-kind-ipv6
  • pull-kubernetes-e2e-ubuntu-gce-network-policies
  • pull-kubernetes-integration
  • pull-kubernetes-node-e2e-containerd
  • pull-kubernetes-typecheck
  • pull-kubernetes-unit
  • pull-kubernetes-verify
  • pull-kubernetes-verify-govet-levee

In response to this:

/test

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/test-infra repository.

@aojea
Copy link
Member

aojea commented Jan 18, 2022

/test pull-kubernetes-e2e-kind-multizone
Thanks
lgtm, wait for Robs and CI feedback

@lzhecheng
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-multizone
I pushed again because the old code change included 2 import k8s.io/kubernetes/test/e2e/framework/skipper by mistake. I removed one this time. Last time all tests are successful except the import check.

@aojea
Copy link
Member

aojea commented Jan 18, 2022

/retest
test is working
LGTM

@aojea
Copy link
Member

aojea commented Jan 18, 2022

/approve
defer LGTM to rob

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, lzhecheng

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2022
Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this @lzhecheng!

nodesByZone := map[string]string{}
zonesWithNodes := map[string][]string{}
Copy link
Member

Choose a reason for hiding this comment

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

Seems like we all we really need is one node name per zone, so a simpler data structure like nodeForZone := map[zone]nodeName{} would work. (Where zone and node name would just be strings).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea!

@@ -124,12 +152,12 @@ var _ = common.SIGDescribe("Feature:Topology Hints", func() {
}
}

nodeList, err := c.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{})
framework.ExpectNoError(err)
nodesByZone := map[string]string{}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this any more

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think it is needed because podsByZone still needs it to set up.

}
nodeCPU, found := node.Status.Allocatable[v1.ResourceCPU]
if !found {
framework.Failf("Error when getting allocatable CPU of Node '%s'", node.Name)
Copy link
Member

Choose a reason for hiding this comment

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

Fail seems appropriate. If the test has not been skipped already, we're likely intentionally trying to run it, so failing will likely provide more noticeable/meaningful output.

@@ -83,6 +84,33 @@ var _ = common.SIGDescribe("Feature:Topology Hints", func() {
framework.ExpectNoError(err, "timed out waiting for DaemonSets to be ready")

nodeNames := e2edaemonset.SchedulableNodes(c, ds)

// All Nodes should have same allocatable CPUs. If not, then skip the test.
nodeNamesMap := map[string]bool{}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a slight rename to indicate that this was specific to schedulable Nodes? Not tied to this specific name, but would help make the rest of the code a bit easier to understand.

Suggested change
nodeNamesMap := map[string]bool{}
schedulableNodes := map[string]bool{}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

lastNodeCPU = nodeCPU
firstNode = false
} else if !nodeCPU.Equal(lastNodeCPU) {
e2eskipper.Skipf("Not all Nodes have same allocatable CPUs. Value of Node '%s' is different from the last one. %d not equals %d",
Copy link
Member

Choose a reason for hiding this comment

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

Maybe reword this to clarify what we expected here.

Suggested change
e2eskipper.Skipf("Not all Nodes have same allocatable CPUs. Value of Node '%s' is different from the last one. %d not equals %d",
e2eskipper.Skipf("Expected Nodes to have equivalent allocatable CPUs, but Node '%s' is different from the previous one. %d not equals %d",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

framework.Failf("Expected zone to be specified for %s node", nodeName)
}
for fromZone, nodes := range zonesWithNodes {
nodeName := nodes[0]
Copy link
Member

Choose a reason for hiding this comment

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

If we move to map[string]string{} as I suggested above, I think this will be a non issue.

@lzhecheng lzhecheng force-pushed the fix-topology-hint-test branch 3 times, most recently from bfde0e9 to 641327e Compare January 19, 2022 02:28
* It should check one Node in a zone instead of
each Node and its fromZone.
* Check Nodes' CPUs if they are equivalent

Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
@lzhecheng
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-multizone

@lzhecheng
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-ipv6

1 similar comment
@lzhecheng
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-ipv6

@robscott
Copy link
Member

Thanks @lzhecheng!

/lgtm

@robscott
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2022
@k8s-ci-robot k8s-ci-robot merged commit 4def789 into kubernetes:master Jan 19, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Jan 19, 2022
@lzhecheng lzhecheng deleted the fix-topology-hint-test branch January 19, 2022 08:32
@lzhecheng
Copy link
Contributor Author

/cherrypick release-1.23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants