Skip to content

[Response Ops] Fix Event Log Flaky E2E Test#227559

Merged
JiaweiWu merged 13 commits intoelastic:mainfrom
JiaweiWu:issue-209911-flaky-test-
Aug 29, 2025
Merged

[Response Ops] Fix Event Log Flaky E2E Test#227559
JiaweiWu merged 13 commits intoelastic:mainfrom
JiaweiWu:issue-209911-flaky-test-

Conversation

@JiaweiWu
Copy link
Contributor

@JiaweiWu JiaweiWu commented Jul 11, 2025

Summary

Resolves: #209911

Fixes a flaky test where the execute-action events were not appearing. This PR changes the test procedure to manually trigger the rule runs instead of letting it run by itself with a low interval.

Checklist

@JiaweiWu JiaweiWu requested a review from a team as a code owner July 11, 2025 03:02
@JiaweiWu JiaweiWu added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.2.0 labels Jul 11, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@JiaweiWu
Copy link
Contributor Author

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#8604

[❌] x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts: 72/100 tests passed.

see run history

@JiaweiWu
Copy link
Contributor Author

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#8648

[❌] x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts: 72/100 tests passed.

see run history

Copy link
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

Fixes look good to me, but there are still some flaky errors? Are these new?

});
};

export const waitForRuleExecute = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'm surprised we didn't already have a function for this, but didn't see one. Since it also takes action executions into account, perhaps adding that in the name? waitForRuleExecuteWithActions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep you're right, I wrote this to wrap getEventLog just to make the test cleaner, however I am trying a different approach that asserts actions execute success so I am removing this.

@JiaweiWu
Copy link
Contributor Author

Haha yea my fix didn't seem to work, trying a new approach 😄

@elastic elastic deleted a comment from kibanamachine Aug 14, 2025
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#9133

[✅] x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts: 100/100 tests passed.

see run history

@elastic elastic deleted a comment from kibanamachine Aug 14, 2025
@darnautov darnautov requested a review from pmuellr August 27, 2025 12:15
Copy link
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM, left a note about having to check on action event logs

});
}

const provider = shouldUseActionsProvider ? 'actions' : 'alerting';
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a case for us having to wait for the action execution, just vs waiting on alert/execute-action? If we're only looking at alerting event logs, I don't think we should need to be looking at the action event logs.

Seems like the existing code should work, but is somewhat overkill, and will be a little slower since it has to wait for the connector to run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea unfortunately we have to check the actions event log because the alert/execute-action is now merely queuing the action. The previously flakiness was caused by this as actions are being queue before the previous actions are finishing, therefore never starting the second actions

@darnautov
Copy link
Contributor

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

merge conflict between base and head

@JiaweiWu JiaweiWu enabled auto-merge (squash) August 29, 2025 18:28
@elasticmachine
Copy link
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts / Alerting eventLog in space default should generate expected events for normal operation
  • [job] [logs] x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts / Alerting eventLog in space default should generate expected events for normal operation

History

@JiaweiWu JiaweiWu merged commit ab20b07 into elastic:main Aug 29, 2025
12 checks passed
jkelas pushed a commit to jkelas/kibana that referenced this pull request Sep 2, 2025
## Summary

Resolves: elastic#209911

Fixes a flaky test where the `execute-action` events were not appearing.
This PR changes the test procedure to manually trigger the rule runs
instead of letting it run by itself with a low interval.

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
ymao1 pushed a commit to ymao1/kibana that referenced this pull request Sep 2, 2025
## Summary

Resolves: elastic#209911

Fixes a flaky test where the `execute-action` events were not appearing.
This PR changes the test procedure to manually trigger the rule runs
instead of letting it run by itself with a low interval.

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
MichelLosier pushed a commit to MichelLosier/kibana that referenced this pull request Sep 2, 2025
## Summary

Resolves: elastic#209911

Fixes a flaky test where the `execute-action` events were not appearing.
This PR changes the test procedure to manually trigger the rule runs
instead of letting it run by itself with a low interval.

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.2.0

Projects

None yet

6 participants