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

unittests: Fixes unit tests for Windows (part 6) #114508

Merged
merged 1 commit into from Jan 31, 2023

Conversation

claudiubelu
Copy link
Contributor

@claudiubelu claudiubelu commented Dec 15, 2022

What type of PR is this?

/sig testing
/sig windows

/kind failing-tests
/priority important-soon
/milestone v1.27

What this PR does / why we need it:

Currently, there are some unit tests that are failing on Windows due to various reasons:

  • On Windows, consecutive time.Now() calls may return the same timestamp, which would cause the TestFreeSpaceRemoveByLeastRecentlyUsed test to flake.
  • tests in kuberuntime_container_windows_test.go fail on Nodes that have fewer than 3 CPUs, expecting the CPU max set to be more than 100% of available CPUs, which is not possible.
  • calls in summary_windows_test.go are missing context.
  • filterTerminatedContainerInfoAndAssembleByPodCgroupKey will filter and group container information by the Pod cgroup key, if it exists. However, we don't have cgroups on Windows, thus we can't make the same assertions.

Which issue(s) this PR fixes:

Related: #51540

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

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


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/windows Categorizes an issue or PR as relevant to SIG Windows. labels Dec 15, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.27 milestone Dec 15, 2022
@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Dec 15, 2022
@k8s-ci-robot
Copy link
Contributor

@claudiubelu: The label(s) kind/failing-tests cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this?

/sig testing
/sig windows

/kind failing-tests
/priority important-soon
/milestone v1.27

What this PR does / why we need it:

Currently, there are some unit tests that are failing on Windows due to various reasons.

Which issue(s) this PR fixes:

Related: #51540

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

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


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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 15, 2022
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. labels Dec 15, 2022
@bart0sh
Copy link
Contributor

bart0sh commented Dec 16, 2022

/kind failing-test

@k8s-ci-robot k8s-ci-robot added kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Dec 16, 2022
@bart0sh
Copy link
Contributor

bart0sh commented Dec 16, 2022

/retest

@bart0sh
Copy link
Contributor

bart0sh commented Dec 16, 2022

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 16, 2022
@bart0sh bart0sh moved this from Triage to Needs Reviewer in SIG Node PR Triage Dec 16, 2022
@claudiubelu claudiubelu force-pushed the unittests-6 branch 5 times, most recently from a8f9f49 to 9787430 Compare January 1, 2023 15:05
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 25, 2023
@claudiubelu claudiubelu force-pushed the unittests-6 branch 2 times, most recently from d2087eb to 57d0570 Compare January 26, 2023 09:14
@claudiubelu
Copy link
Contributor Author

/test pull-ci-kubernetes-unit-windows

@claudiubelu
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind

@claudiubelu
Copy link
Contributor Author

Note: The Windows unit tests ran on this PR [1], and the following tests that are enabled / touched in this PR passed:

k8s.io/kubernetes/pkg/apis/batch/validation: TestValidateCronJob/spec.timeZone:_Invalid_value:_"Continent/Zone_":_unknown_time_zone_Continent/Zone_
k8s.io/kubernetes/pkg/kubelet/images: TestFreeSpaceRemoveByLeastRecentlyUsed
k8s.io/kubernetes/pkg/kubelet/kuberuntime: TestApplyPlatformSpecificContainerConfig
k8s.io/kubernetes/pkg/kubelet/server/stats: TestSummaryProvider
k8s.io/kubernetes/pkg/kubelet/stats: TestFilterTerminatedContainerInfoAndAssembleByPodCgroupKey

Note: this PR also fixes the only remaining consistently failing (and not failing) unit tests on Windows (k8s.io/kubernetes/pkg/kubelet/kuberuntime.TestApplyPlatformSpecificContainerConfig), and fixes a flaky test on Windows (k8s.io/kubernetes/pkg/kubelet/images.TestFreeSpaceRemoveByLeastRecentlyUsed) [2]

[1] https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/114508/pull-ci-kubernetes-unit-windows/1618920132325675008
[2] https://testgrid.k8s.io/sig-windows-signal#windows-unit-master

@claudiubelu claudiubelu force-pushed the unittests-6 branch 2 times, most recently from 50d2dea to 5d6ef3b Compare January 31, 2023 07:14
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 31, 2023
@claudiubelu claudiubelu force-pushed the unittests-6 branch 3 times, most recently from 1c32e6b to 3561955 Compare January 31, 2023 09:56
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- On Windows, consecutive time.Now() calls may return the same timestamp, which would cause
  the TestFreeSpaceRemoveByLeastRecentlyUsed test to flake.
- tests in kuberuntime_container_windows_test.go fail on Nodes that have fewer than 3 CPUs,
  expecting the CPU max set to be more than 100% of available CPUs, which is not possible.
- calls in summary_windows_test.go are missing context.
- filterTerminatedContainerInfoAndAssembleByPodCgroupKey will filter and group container
  information by the Pod cgroup key, if it exists. However, we don't have cgroups on Windows,
  thus we can't make the same assertions.
@liggitt
Copy link
Member

liggitt commented Jan 31, 2023

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d302f9c60585712e8048f0242b51752a0655e7dc

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: claudiubelu, liggitt

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 31, 2023
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jan 31, 2023

@claudiubelu: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-e2e-capz-conformance e94abd476f41113322a02d75f3f87d50a9867ef7 link false /test pull-kubernetes-e2e-capz-conformance

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@claudiubelu
Copy link
Contributor Author

/test pull-kubernetes-unit

@k8s-ci-robot k8s-ci-robot merged commit f58f70b into kubernetes:master Jan 31, 2023
SIG Node CI/Test Board automation moved this from PRs - Needs Reviewer to Done Jan 31, 2023
SIG Node PR Triage automation moved this from Waiting on Author to Done Jan 31, 2023
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/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Development

Successfully merging this pull request may close these issues.

None yet

6 participants