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

Add e2e test for HPA behavior: decreased downscale stabilization #108264

Merged

Conversation

pbetkier
Copy link
Contributor

What type of PR is this?

e2e test (what's the proper kind for this?)

What this PR does / why we need it:

Currently there are no e2e tests for HPA behavior. They are requested by #102369. More PRs will follow for other cases.

Which issue(s) this PR fixes:

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. 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. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 21, 2022
@k8s-ci-robot
Copy link
Contributor

@pbetkier: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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
Copy link
Contributor

Hi @pbetkier. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 21, 2022
@k8s-ci-robot k8s-ci-robot added area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 21, 2022
@pbetkier
Copy link
Contributor Author

cc @josephburnett

@pbetkier
Copy link
Contributor Author

cc @krzysied @jbartosik

@oomichi
Copy link
Member

oomichi commented Feb 22, 2022

@pbetkier
Copy link
Contributor Author

pbetkier commented Feb 24, 2022

The tests in horizontal_pod_autoscaling.go have looser expectations. They work on default settings (basic scenarios) and verify that an expected state is eventually reached. They often verify decision stability (~20min runs per test by desgin). They also verify support for all types of targets (Deployment, ReplicaSet, ReplicationController).

The behavior tests are meant to verify exactly how the state was reached, exercising various configuration options of the behavior spec. This test here is about downscale stabilization period (note the downScaleStabilization passed to HPA creation function), but 2-3 more are coming.

The test setups for horizontal_pod_autoscaling.go, horizontal_pod_autoscaling_behavior.go and custom_metrics_stackdriver_autoscaling.go should eventually converge to reduce duplication. I plan to do it after I finish all the behavior tests and know the exact needs for the new, common setup.

@pbetkier pbetkier force-pushed the hpa-behavior-e2e-tests-downscale branch from e250776 to da266e1 Compare February 25, 2022 13:14
@pbetkier
Copy link
Contributor Author

pbetkier commented Feb 25, 2022

Rebased to contain #108104 and addressed comments from @jbartosik.

Copy link
Contributor

@jbartosik jbartosik left a comment

Choose a reason for hiding this comment

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

/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 Feb 25, 2022
@jbartosik
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 25, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 25, 2022
@jbartosik
Copy link
Contributor

/remove-lgtm

let's wait for tests

@jbartosik
Copy link
Contributor

/lgtm cancel

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 25, 2022
@pbetkier
Copy link
Contributor Author

/retest

1 similar comment
@pbetkier
Copy link
Contributor Author

/retest

@pbetkier
Copy link
Contributor Author

pbetkier commented Mar 1, 2022

I'm going to rebase. I've seen other PRs also fail on these conformance tests before. Note that my changes don't touch code used in conformance.

@pbetkier pbetkier force-pushed the hpa-behavior-e2e-tests-downscale branch from da266e1 to 13c3f09 Compare March 1, 2022 08:24
@pbetkier
Copy link
Contributor Author

pbetkier commented Mar 1, 2022

/retest

@pbetkier
Copy link
Contributor Author

pbetkier commented Mar 1, 2022

@jbartosik finally the tests passed.

@jbartosik
Copy link
Contributor

/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 Mar 1, 2022
@pbetkier
Copy link
Contributor Author

pbetkier commented Mar 2, 2022

@oomichi could you have a look?

@pbetkier
Copy link
Contributor Author

pbetkier commented Mar 7, 2022

@MaciekPytel could you have a look as a sig-autoscaling approver?

@pbetkier
Copy link
Contributor Author

pbetkier commented Mar 8, 2022

@fejta could you approve as a sig-testing approver?

@MaciekPytel
Copy link
Contributor

/approve

@fejta
Copy link
Contributor

fejta commented Mar 14, 2022

Can we please create an OWNERS file in https://github.com/kubernetes/kubernetes/tree/13c3f091a7d6e0dec6e329c9d511875aae337661/test/e2e/framework/autoscaling that allows the autoscaling team to approve autoscaling test framework PRs?

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fejta, jbartosik, MaciekPytel, pbetkier

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 Mar 14, 2022
@pbetkier
Copy link
Contributor Author

Can we please create an OWNERS file in https://github.com/kubernetes/kubernetes/tree/13c3f091a7d6e0dec6e329c9d511875aae337661/test/e2e/framework/autoscaling that allows the autoscaling team to approve autoscaling test framework PRs?

Yes! I had this idea today as well. Will do.

@pbetkier
Copy link
Contributor Author

/kind feature

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Mar 14, 2022
@k8s-ci-robot k8s-ci-robot merged commit 5c98eb5 into kubernetes:master Mar 14, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 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. area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants