Flaky test: Detection rule telemetry #162407 (#162681)

## Summary

Original ticket: https://github.com/elastic/kibana/issues/156088

It looks like flakiness happens due to another rule from previous test
case being scheduled by alerting framework and running even after we
deleted it (since we called delete rule after it was scheduled). That
rule scheduled earlier produces some unexpected artifacts in metrics,
specifically `stats.detection_rules.detection_rule_status` where
occasionally see

<img width="1255" alt="Screenshot 2023-07-25 at 15 13 29"
src="5d1cc334-25b5-4bf2-8822-c9858a0b72bf">

Since, in this test case the rule is disabled, we should not see this
data.

As a fix, we decided to test against specific metrics attributes
`stats.detection_rules.detection_rule_usage` which we expect being
updated.
This commit is contained in:
Ievgen Sorokopud 2023-07-31 11:43:54 +02:00 committed by GitHub
parent 0e081d84f2
commit 9036b15be0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23