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
integration: refactor and split scheduler tests #109834
integration: refactor and split scheduler tests #109834
Conversation
@aojea: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
/assign @wojtek-t @alculquicondor This will stop the bleeding, sig-scheduling can work independently on improving the tests after this if they want, but we should be less impacted by the global timeout, waiting for the results to confirm though ... 👀 |
pod, err := createPausePod(testCtx.ClientSet, | ||
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name})) | ||
pod, err := testutils.CreatePausePod(testCtx.ClientSet, | ||
testutils.InitPausePod(&testutils.PausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also maybe those function's aren't super controversial, but I would actually move them not to testutils, but rather to test/integration/scheduler/utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
I just said the same before I saw your comment 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems that the integrations/util is mainly by scheduler folks already
https://github.com/kubernetes/kubernetes/pull/109834/files#r866610966
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of failures... I couldn't find any obvious mistakes.
But one of the failures is a timeout, even after the split? That sounds crazy.
test/integration/util/util.go
Outdated
|
||
// InitTest initializes a test environment and creates API server and scheduler with default | ||
// configuration. | ||
func InitTest(t *testing.T, nsPrefix string, opts ...scheduler.Option) *TestContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps InitTestScheduler
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh, already exists 😄
more reason to merge this to avoid drifting
|
||
// InitDisruptionController initializes and runs a Disruption Controller to properly | ||
// update PodDisuptionBudget objects. | ||
func InitDisruptionController(t *testing.T, testCtx *TestContext) *disruption.DisruptionController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are a lot of function that are now under the ownership of sig-testing. Are you comfortable with that?
Maybe we can have a test/integration/scheduler/util
package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scheduler are the main users of the library already
grep -r "k8s.io/kubernetes/test/integration/util" test/integration/
test/integration/ipamperf/cloud.go: "k8s.io/kubernetes/test/integration/util"
test/integration/ipamperf/ipam_test.go: "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/preemption_test.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/priorities_test.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/queue_test.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/scheduler_test.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/taint_test.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/extender_test.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/framework_test.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/predicates_test.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler/util/util.go: testutils "k8s.io/kubernetes/test/integration/util"
test/integration/scheduler_perf/util.go: "k8s.io/kubernetes/test/integration/util"
test/integration/node/lifecycle_test.go: testutils "k8s.io/kubernetes/test/integration/util"
and there are already scheduler only things like
kubernetes/test/integration/util/util.go
Lines 384 to 396 in a330d3b
// InitTestScheduler initializes a test environment and creates a scheduler with default | |
// configuration. | |
func InitTestScheduler( | |
t *testing.T, | |
testCtx *TestContext, | |
) *TestContext { | |
// Pod preemption is enabled by default scheduler configuration. | |
return InitTestSchedulerWithOptions(t, testCtx) | |
} | |
// InitTestSchedulerWithOptions initializes a test environment and creates a scheduler with default | |
// configuration and other options. | |
func InitTestSchedulerWithOptions( |
I think that is simpler to have only one util package, I don't think that we suffers of bottlenecks on reviews and approvals in the integration framework, so if you don't mind I prefer to have only one package
the failures may be related to something wrong I did, I will redo it tomorrow following your comments |
86ff0a2
to
277bcdb
Compare
277bcdb
to
9dbe4c8
Compare
There is a bunch of cleanup I would like to see in those utility functions, but that's not the request for this PR anyway... /lgtm Thanks! |
this reduces the times significatively
I have lint errors because of unused variables :/ |
/test pull-kubernetes-unit |
timeout error unrelated to this Pr /retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, wojtek-t 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 |
Thanks! I'll take some days to clean up the mess. |
We wouldn't cherry-pick this, would we? |
…4-upstream-release-1.24 Automated cherry pick of #109834: integration: refactor and split scheduler tests
/kind cleanup
/kind failing-test
Fixes #109783
The scheduler jobs on integration are close to the timeout of 10m (default in golang) , causing that sometimes the test panic and fails because of the timeout.
Splitting the tests in subdirectories, will run the subtests independently, with a 10m timeout per subtest