Refactor featuregate setup in tests to reduce possibility of flaky tests conflicts#9600
Refactor featuregate setup in tests to reduce possibility of flaky tests conflicts#96000xlen wants to merge 3 commits intokubernetes-sigs:mainfrom
Conversation
…for DynamicResourceAllocation, AdmissionFairSharing, and TASBalancedPlacement
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
|
Welcome @0xlen! |
|
Hi @0xlen. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/ok-to-test |
| ) | ||
|
|
||
| ginkgo.BeforeAll(func() { | ||
| gomega.Expect(features.SetEnable(features.DynamicResourceAllocation, true)).To(gomega.Succeed()) |
There was a problem hiding this comment.
Can we remove features.SetEnable()? It looks like it’s no longer used.
There was a problem hiding this comment.
Thank you @mbobrovskyi - I didn't find any other references for SetEnable . Remove them and verified in test after removing in the latest commit.
test/integration/singlecluster/scheduler/fairsharing/suite_test.go
Outdated
Show resolved
Hide resolved
…d TASBalancedPlacement
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 0xlen The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
/area testing
What this PR does / why we need it:
This PR updates integration tests to use
features.SetFeatureGateDuringTest(...)instead offeatures.SetEnable(...)for the following feature gates:DynamicResourceAllocationAdmissionFairSharingTASBalancedPlacementIn
dra_test.go, move DRA gate setup fromBeforeAlltoBeforeEachto scope gate lifecycle per-spec and avoid feature-gate parallel cleanup conflicts.Why this is needed
Using
SetEnablein integration tests can leak feature-gate state across tests and contribute to flakiness.SetFeatureGateDuringTestbinds feature-gate mutation to test lifecycle and restores state automatically, improving test isolation.Additionally, in
multikueue/dra_test.go, moving gate setup toBeforeEachavoids potential parallel gate cleanup collisions observed during validation.Which issue(s) this PR fixes:
Fixes #9594
Does this PR introduce a user-facing change?