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

Failing test: X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log·ts - alerting api integration spaces only Alerting eventLog should generate expected events for normal operation #81668

Closed
kibanamachine opened this issue Oct 26, 2020 · 6 comments · Fixed by #84189
Assignees
Labels
blocker failed-test A test failure on a tracked branch, potentially flaky-test Feature:Alerting skipped-test Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 26, 2020

A test failed on a tracked branch

Error: expected false to equal true
    at Assertion.assert (/dev/shm/workspace/parallel/5/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.be.Assertion.equal (/dev/shm/workspace/parallel/5/kibana/packages/kbn-expect/expect.js:227:8)
    at Assertion.be (/dev/shm/workspace/parallel/5/kibana/packages/kbn-expect/expect.js:69:22)
    at Context.it (test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts:91:44)

First failure: Jenkins Build

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Oct 26, 2020
@mistic mistic added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Oct 26, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@kibanamachine
Copy link
Contributor Author

New failure: Jenkins Build

@kibanamachine
Copy link
Contributor Author

New failure: Jenkins Build

@mistic
Copy link
Member

mistic commented Nov 23, 2020

That test as failed again both on master and 7.x and it looks flaky, skipping for now.

master: 0a0672f
7.x: 775f543

@pmuellr
Copy link
Member

pmuellr commented Nov 24, 2020

The test failure is on line 91 here:

expect(executeEvents.length >= 4).to.be(true);
expect(executeActionEvents.length).to.be(2);
expect(newInstanceEvents.length).to.be(1);
expect(resolvedInstanceEvents.length).to.be(1);

It seems like we could change this to the following:

      expect(executeEvents.length >= 3).to.be(true);

And should probably use the correct expect usage of .not.lessThan(3) instead of the inlined boolean, to get a better diagnostic the next time it fails :-)

Rationale for changing:

  • we only bother checking 3 execute events below this
  • we only bother checking 1 execute action events below this
  • for any cases where we checking a length to be 1 (or greater), that's already assumed in the retry() block above this, which will stop retrying once you have at least one of every action requested

It could be that the timing on this stuff changed once we started buffering the events. Eg, we now write out execute AFTER all the other events being checked, but back-dated to when the alert executor started. We used to write it out first. So missing an executeEvent makes some sense to me - it have been pushed out to a different buffer than the others, and so the last one might be "dropped" (but would magically appear a second later!).

@gmmorris
Copy link
Contributor

It appeared to be a timing thing, as it did actually have 4 execute events.
You can see my solution here: #84189
It ensure we wait until the 4th even before exiting the retry....

@kobelb kobelb added the needs-team Issues missing a team label label Jan 31, 2022
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker failed-test A test failure on a tracked branch, potentially flaky-test Feature:Alerting skipped-test Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants