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

[Alerting] fix flaky test for index threshold grouping #60792

Merged
merged 1 commit into from
Mar 21, 2020

Conversation

pmuellr
Copy link
Member

@pmuellr pmuellr commented Mar 20, 2020

resolves #60744

This is a fairly complex test, with alerts that run actions that write to
an index which we then do queries over. The tests didn't account for some
slop in all that async activity, but now should be about as flake-free as they
can be.

@pmuellr pmuellr added Feature:Alerting v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Mar 20, 2020
@pmuellr pmuellr requested a review from a team as a code owner March 20, 2020 18:48
@@ -135,7 +135,8 @@ export default function alertTests({ getService }: FtrProviderContext) {
}

// there should be 2 docs in group-0, rando split between others
expect(inGroup0).to.be(2);
Copy link
Member Author

Choose a reason for hiding this comment

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

In these tests, there should be two actions scheduled for every alert interval, one in one "group", the other in a different one, and we wait for 2 turns of the alert interval. There are always three groups of data in the index, but termSize will limit only two groups being returned - the "top" one, and one of the others (which we don't care about, as it's random-ish). For count (this test), group-0 has more docs, and so should be present in the output. For the sum (below), group-3 has larger values, and so should be present. For min (below sum), group-0 has smaller values, and so should be present.

While there should be 2 docs in the "top" group, the test failure this was written for got 3 at one point. Seems to be a very-rarely-flaky situation, so the check was changed from === 2 to > 0, to account for slop in the opposite direction as well (only getting 1 instead of 2).

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

LGTM!

@pmuellr
Copy link
Member Author

pmuellr commented Mar 20, 2020

@pmuellr
Copy link
Member Author

pmuellr commented Mar 20, 2020

flaky test runner didn't find anything: https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/278/ , will merge in a bit ...

resolves elastic#60744

This is a fairly complex test, with alerts that run actions that write to
an index which we then do queries over.  The tests didn't account for some
slop in all that async activity, but now should be about as flake-free as they
can be.
@pmuellr pmuellr force-pushed the alerting/min-grouped-test-fail branch from 9ec6d51 to 0de2ffd Compare March 20, 2020 21:18
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@pmuellr pmuellr merged commit e731592 into elastic:master Mar 21, 2020
pmuellr added a commit to pmuellr/kibana that referenced this pull request Mar 21, 2020
resolves elastic#60744

This is a fairly complex test, with alerts that run actions that write to
an index which we then do queries over.  The tests didn't account for some
slop in all that async activity, but now should be about as flake-free as they
can be.
pmuellr added a commit that referenced this pull request Mar 21, 2020
resolves #60744

This is a fairly complex test, with alerts that run actions that write to
an index which we then do queries over.  The tests didn't account for some
slop in all that async activity, but now should be about as flake-free as they
can be.
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 23, 2020
* master: (39 commits)
  [APM]Create custom link from Trace summary (elastic#59648)
  [ML] Fixing app clean up (elastic#60853)
  [SIEM] Use ECS categorisation for Authentication widgets (elastic#60734)
  [NP] Remove kbnUrl usage in discover/dashboard/visualize (elastic#60016)
  Skip failing test
  [Uptime]Update fetch effect failed action handling (elastic#60742)
  [npm] upgrade elastic/maki (elastic#60829)
  [Uptime] Add Settings Page (elastic#53550)
  [APM] service maps: avoid unnecesary `useDeepObjectIdentity` (elastic#60836)
  [Index management] Re-enable index template tests (elastic#60780)
  Fixed UI/UX issues: alerts delete confirmation, combobox behaviors (elastic#60703)
  [SIEM] Fix patching of ML Rules (elastic#60830)
  [APM] Service Map - Separate overlapping edges by rotating nodes (elastic#60477)
  [Alerting] fix flaky test for index threshold grouping (elastic#60792)
  [SIEM][Detection Engine] Adds test scripts for machine learning feature
  Flatten child api response for resolver (elastic#60810)
  Change "url" to "urls" in APM agent instructions (elastic#60790)
  [DOCS] Updates API requests and examples (elastic#60695)
  [SIEM] [Cases] Create case from timeline (elastic#60711)
  [Lens] Resetting a layer generates new suggestions (elastic#60674)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.7.0 v8.0.0
Projects
None yet
4 participants