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

Move default policy creation in controller tests to BeforeSuite. #604

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

ykulazhenkov
Copy link
Collaborator

This is required to fix the following problem:
SriovOperatorConfigReconciler starts in the BeforeSuite handler, the default OperatorConfig is also created in BeforeSuite. That means the SriovOperatorConfigReconciler will be triggered with the first test in the controller suite.

SriovOperatorConfigReconciler will fail (return an error) until DefaultPolicy is created by the BeforeEach function in sriovoperatorconfig_controller_test.go.

The problem is that tests in sriovoperatorconfig_controller_test.go starts after the test in some other *_test.go files in the controller package. At the time when tests from sriovoperatorconfig_controller_test.go are eventually executed, SriovOperatorConfigReconciler controller is already failed multiple times in a row (because there was no default policy) and is waiting with a backoff delay (already quite large) before reconcilation retry.

This is required to fix the following problem:
SriovOperatorConfigReconciler starts in the BeforeSuite handler, the default OperatorConfig is also created in BeforeSuite. That means the SriovOperatorConfigReconciler will be triggered with the first test in the controller suite.

SriovOperatorConfigReconciler will fail (return an error) until DefaultPolicy is created by the BeforeEach function in sriovoperatorconfig_controller_test.go.

The problem is that tests in sriovoperatorconfig_controller_test.go starts after the test in some other *_test.go files in the controller package.  At the time when tests from sriovoperatorconfig_controller_test.go are eventually executed,
SriovOperatorConfigReconciler controller is already failed multiple times in a row (because there was no default policy) and is waiting with a backoff delay (already quite large) before reconcilation retry.

Signed-off-by: Yury Kulazhenkov <[email protected]>
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@zeeke zeeke requested a review from e0ne January 31, 2024 17:10
Copy link
Member

@zeeke zeeke left a comment

Choose a reason for hiding this comment

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

LGTM

thanks for looking at this

@e0ne e0ne merged commit 36394ac into k8snetworkplumbingwg:master Jan 31, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants