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 VerdictReset variable to ResultData struct to fix verdict metrics never reseting to 0 #120 #143

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

Calvinaud
Copy link
Contributor

@Calvinaud Calvinaud commented Aug 1, 2023

  • types.go: Added the VerdictReset to ResultData struct
  • collect-data.go: Add condition so chaosresult is skipped when the chaosengine is completed and the verdict was reseted
  • handle-result-deletion: - Add setter for VerdictReset - Added setter during initialization of resultDetails - Set the verdictReset value to reset variable in unsetOutdatedMetrics

What this PR does / why we need it:

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

Special notes for your reviewer:

Checklist:

- types.go: Added the VerdictReset to ResultData struct
- collect-data.go: Add condition so chaosresult is skipped when the chaosengine is completed and the verdict was reseted
- handle-result-deletion:
    - Add setter for VerdictReset
    - Added setter during initialization of resultDetails
    - Set the verdictReset value to reset variable in unsetOutdatedMetrics

Signed-off-by: Calvin Audier <[email protected]>
- Adding TSDB_SCRAPE_INTERVAL for the test
- Seperating the fetching of the metric in a seperate function
- Checking for a verdict on the chaosresult instead of waiting fix amount of time

Signed-off-by: Calvin Audier <[email protected]>
@Calvinaud Calvinaud marked this pull request as ready for review August 4, 2023 14:32
@Calvinaud
Copy link
Contributor Author

Calvinaud commented Aug 4, 2023

Hello,

For the testing part of this part I update the BDD case 2 directly since for me it was on the same scope.
Don't hesitate to tell me if you prefer I create a new test case for the checks I added.

Copy link
Member

@neelanjan00 neelanjan00 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ispeakc0de ispeakc0de merged commit 55700d7 into litmuschaos:master Aug 24, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"litmuschaos_experiment_verdict" annotation is visible continuously even after the experiment has completed
3 participants