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 flaky unit test which check the default operator namespace #1296

Merged
merged 4 commits into from
Nov 14, 2022

Conversation

ccojocar
Copy link
Contributor

@ccojocar ccojocar commented Nov 11, 2022

What type of PR is this?

/kind failing-test

What this PR does / why we need it:

This unit test cannot run in parallel because environment variables are global causing random failures. This happens because one test case invalidates the other.

Which issue(s) this PR fixes:

Does this PR have test?

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix flaky unit test which checks default operator namespace.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Nov 11, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 11, 2022
@pjbgf
Copy link
Member

pjbgf commented Nov 12, 2022

We will need to set lint ignore to get linter happy on the below:

Error: internal/pkg/config/config_test.go:23:1: Function TestGetOperatorNamespace missing the call to method parallel (paralleltest)
func TestGetOperatorNamespace(t *testing.T) {
^
Error: internal/pkg/config/config_test.go:42:2: Range statement for test TestGetOperatorNamespace missing the call to method parallel in test Run (paralleltest)
	for _, tt := range tests {
	^

Copy link
Contributor

@JAORMX JAORMX left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 14, 2022
@ccojocar ccojocar force-pushed the fix_flacky_unit_test branch from 0f7012c to 72e5aba Compare November 14, 2022 08:33
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2022
@ccojocar
Copy link
Contributor Author

/test all

@ccojocar ccojocar force-pushed the fix_flacky_unit_test branch from 72e5aba to 22e1e0f Compare November 14, 2022 09:08
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2022
@ccojocar
Copy link
Contributor Author

/test all

@ccojocar
Copy link
Contributor Author

/retest

@ccojocar
Copy link
Contributor Author

/test all

@ccojocar
Copy link
Contributor Author

/test e2e

@k8s-ci-robot
Copy link
Contributor

@ccojocar: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-security-profiles-operator-build
  • /test pull-security-profiles-operator-build-image
  • /test pull-security-profiles-operator-test-e2e
  • /test pull-security-profiles-operator-test-unit
  • /test pull-security-profiles-operator-verify

Use /test all to run all jobs.

In response to this:

/test e2e

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.

@ccojocar
Copy link
Contributor Author

/test pull-security-profiles-operator-test-e2e

This unit test cannot run in parallel because environment variables
are global causing random failures. This happens because one test
case invalidates the other.
@ccojocar ccojocar force-pushed the fix_flacky_unit_test branch from 11ddf50 to 3a6c6dc Compare November 14, 2022 10:46
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ccojocar, JAORMX, saschagrunert

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:
  • OWNERS [JAORMX,saschagrunert]

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 merged commit 5a2ad06 into kubernetes-sigs:main Nov 14, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants