Fix flaky tests for Bucket-Level Monitor #318
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Mohammad Qureshi 47198598+qreshi@users.noreply.github.com
Issue #, if available: #298
Description of changes:
Monitor configurations are randomized during the plugin integration tests for the components that aren't being explicitly tested for specific scenarios so the test cases aren't overfit for a single situation. For Bucket-Level Monitors, this could lead to the Actions under a Trigger to sometimes be empty (0 Actions) or contain Actions in such a configuration that it no-ops (i.e. PerExecutionScope with no Alert categories configured). These types of configurations were rare but led to resulting Alerts to either be null (for new Alerts) or not updated (for existing Alerts) in some tests which failed assertions, making these tests flaky. This PR updates those tests to account for this scenario to ensure that these cases don't happen.
Commands used to reproduce the flaky tests (confirmed they passed after the changes):
Re-ran tests multiple times afterwards to check for any other flaky tests:
CheckList:
[x] Commits are signed per the DCO using --signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.