-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 Unit Tests that verify stats reporting in autoscaler #6912
Conversation
Hi @MIBc. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/assign @vagababov |
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.
Thanks. This looks reasonable.
Can you also check that PanicM
is set and unset.
@@ -65,6 +66,46 @@ func expectedEBC(totCap, targetBC, recordedConcurrency, numPods float64) int32 { | |||
return int32(math.Floor(totCap/targetUtilization*numPods - targetBC - recordedConcurrency)) | |||
} | |||
|
|||
func expectedExcessBCF(originalReadyPodsCount int, totalValue, observedStableValue, targetBurstCapacity float64) float64 { |
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.
this is the same as the method above just with different argument names and order
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.
I have combined these two tests and added PanicM.
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.
I meant expectedEBC
is an existing method. This method you wrote is a duplicate and can be removed.
@@ -65,6 +66,46 @@ func expectedEBC(totCap, targetBC, recordedConcurrency, numPods float64) int32 { | |||
return int32(math.Floor(totCap/targetUtilization*numPods - targetBC - recordedConcurrency)) | |||
} | |||
|
|||
func expectedExcessBCF(originalReadyPodsCount int, totalValue, observedStableValue, targetBurstCapacity float64) float64 { |
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.
I meant expectedEBC
is an existing method. This method you wrote is a duplicate and can be removed.
a.expectScale(t, time.Now(), 5, expectedEBC(10, 100, 50, 1), true) | ||
spec, podCounter := a.currentSpecAndPC() | ||
originalReadyPodsCount, _ := podCounter.ReadyCount() | ||
wantTags := map[string]string{} |
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.
Shouldn't the tags be non-empty?
I think we create the autoscaler with empty context, but for this test we probably want a one with tags set to make sure we use the correct one.
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.
Done
6c78af3
to
7540d70
Compare
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MIBc, vagababov 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 |
/retest |
@MIBc: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
/ok-to-test |
The following jobs failed:
Automatically retrying due to test flakiness... |
/lgtm |
Fixes #6772