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

Refactor updateStopRules and add tests #2361

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

forsaken628
Copy link
Contributor

What this PR does / why we need it:

Reorganize the scattered status. Add tests.
There should be a bug here. Step will be less than zero.

if _, ok := metricStartStep[rule.Name]; ok {
metricStartStep[rule.Name]--
if metricStartStep[rule.Name] != 0 {
return stopRules, optimalObjValue
}
}

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Checklist:

  • Docs included if any changes are user facing

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign andreyvelich for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Signed-off-by: forsaken628 <[email protected]>
@andreyvelich
Copy link
Member

There should be a bug here. Step will be less than zero.

Thank you for refactoring these functions and add tests @forsaken628!
Please can you explain the use-case when step will be less than zero and why we don't catch this bug in our E2Es ?

Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants