-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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: Rule Bulk Actions API Integration Tests - ESS - Rule bulk actions logic.x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess·ts - Rule Bulk Action API @ess perform_bulk_action - ESS specific logic legacy investigation fields should export rules with legacy investigation_fields and transform legacy field in response #173804
Comments
@MadameSheema Could you please skip this one? |
/skip |
Skipped main: 42353e7 |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
I tried reproducing the flakiness by running the bad test through the flaky test runner a couple times (one, two), but it was all green. Either I am doing it wrong or we fixed it in one of the other tickets (or it's a Christmas miracle and it fixed itself!). Shall I close it for now? @banderror @MadameSheema |
@nikitaindik I think we discussed a couple of options what can be checked over zoom, any updates on that? |
export const migrateLegacyInvestigationFields = (
investigationFields: InvestigationFieldsCombined | undefined
): InvestigationFields | undefined => {
if (investigationFields && Array.isArray(investigationFields)) {
if (investigationFields.length) {
return {
field_names: investigationFields,
};
}
return undefined;
}
return investigationFields;
}; It would return
Currently checking if there's a way to end up with a rule that has |
**Resolves: #173804** 500 runs of the flaky test file in ESS env: [Buildkite 4833](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4833) ## Summary Even though I couldn't reproduce flakiness (1.5K runs), I've updated the test to fix a suspected race condition. What seems to be happening: In the `beforeEach` [here](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L477), three rules are created: - one with investigation_fields equal to `['client.address', 'agent.name']` - one with investigation_fields equal to `[]` - one with investigation_fields equal to `{ field_names: ['host.name'] }` Then, in the [test](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L506), we read all three rules and check them in that same order. But if the `[]` rule is created on the backend before the `['client.address', 'agent.name']` rule, our first check would fail. Other tests in this file don't expect rules to come in a particular order. Instead, they search for a needed rule in the array. I used the same approach for this flaky test.
…4757) **Resolves: elastic#173804** 500 runs of the flaky test file in ESS env: [Buildkite 4833](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4833) Even though I couldn't reproduce flakiness (1.5K runs), I've updated the test to fix a suspected race condition. What seems to be happening: In the `beforeEach` [here](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L477), three rules are created: - one with investigation_fields equal to `['client.address', 'agent.name']` - one with investigation_fields equal to `[]` - one with investigation_fields equal to `{ field_names: ['host.name'] }` Then, in the [test](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L506), we read all three rules and check them in that same order. But if the `[]` rule is created on the backend before the `['client.address', 'agent.name']` rule, our first check would fail. Other tests in this file don't expect rules to come in a particular order. Instead, they search for a needed rule in the array. I used the same approach for this flaky test. (cherry picked from commit 3213541)
…4757) (#175732) # Backport This will backport the following commits from `main` to `8.12`: - [[Security Solution] Unskip bulk actions integration tests (#174757)](#174757) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nikita Indik","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-26T17:33:09Z","message":"[Security Solution] Unskip bulk actions integration tests (#174757)\n\n**Resolves: #173804** \r\n\r\n500 runs of the flaky test file in ESS env: [Buildkite\r\n4833](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4833)\r\n\r\n## Summary\r\nEven though I couldn't reproduce flakiness (1.5K runs), I've updated the\r\ntest to fix a suspected race condition.\r\n\r\nWhat seems to be happening:\r\nIn the `beforeEach`\r\n[here](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L477),\r\nthree rules are created:\r\n- one with investigation_fields equal to `['client.address',\r\n'agent.name']`\r\n - one with investigation_fields equal to `[]`\r\n- one with investigation_fields equal to `{ field_names: ['host.name']\r\n}`\r\n\r\nThen, in the\r\n[test](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L506),\r\nwe read all three rules and check them in that same order. But if the\r\n`[]` rule is created on the backend before the `['client.address',\r\n'agent.name']` rule, our first check would fail.\r\n\r\nOther tests in this file don't expect rules to come in a particular\r\norder. Instead, they search for a needed rule in the array. I used the\r\nsame approach for this flaky test.","sha":"32135418d6ec15fd9405dc2884e181665709f0ae","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","test-coverage","Team:Detections and Resp","Team: SecuritySolution","Feature:Rule Management","Team:Detection Rule Management","v8.12.1","v8.13.0"],"number":174757,"url":"https://github.com/elastic/kibana/pull/174757","mergeCommit":{"message":"[Security Solution] Unskip bulk actions integration tests (#174757)\n\n**Resolves: #173804** \r\n\r\n500 runs of the flaky test file in ESS env: [Buildkite\r\n4833](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4833)\r\n\r\n## Summary\r\nEven though I couldn't reproduce flakiness (1.5K runs), I've updated the\r\ntest to fix a suspected race condition.\r\n\r\nWhat seems to be happening:\r\nIn the `beforeEach`\r\n[here](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L477),\r\nthree rules are created:\r\n- one with investigation_fields equal to `['client.address',\r\n'agent.name']`\r\n - one with investigation_fields equal to `[]`\r\n- one with investigation_fields equal to `{ field_names: ['host.name']\r\n}`\r\n\r\nThen, in the\r\n[test](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L506),\r\nwe read all three rules and check them in that same order. But if the\r\n`[]` rule is created on the backend before the `['client.address',\r\n'agent.name']` rule, our first check would fail.\r\n\r\nOther tests in this file don't expect rules to come in a particular\r\norder. Instead, they search for a needed rule in the array. I used the\r\nsame approach for this flaky test.","sha":"32135418d6ec15fd9405dc2884e181665709f0ae"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/174757","number":174757,"mergeCommit":{"message":"[Security Solution] Unskip bulk actions integration tests (#174757)\n\n**Resolves: #173804** \r\n\r\n500 runs of the flaky test file in ESS env: [Buildkite\r\n4833](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4833)\r\n\r\n## Summary\r\nEven though I couldn't reproduce flakiness (1.5K runs), I've updated the\r\ntest to fix a suspected race condition.\r\n\r\nWhat seems to be happening:\r\nIn the `beforeEach`\r\n[here](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L477),\r\nthree rules are created:\r\n- one with investigation_fields equal to `['client.address',\r\n'agent.name']`\r\n - one with investigation_fields equal to `[]`\r\n- one with investigation_fields equal to `{ field_names: ['host.name']\r\n}`\r\n\r\nThen, in the\r\n[test](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L506),\r\nwe read all three rules and check them in that same order. But if the\r\n`[]` rule is created on the backend before the `['client.address',\r\n'agent.name']` rule, our first check would fail.\r\n\r\nOther tests in this file don't expect rules to come in a particular\r\norder. Instead, they search for a needed rule in the array. I used the\r\nsame approach for this flaky test.","sha":"32135418d6ec15fd9405dc2884e181665709f0ae"}}]}] BACKPORT-->
…4757) **Resolves: elastic#173804** 500 runs of the flaky test file in ESS env: [Buildkite 4833](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4833) ## Summary Even though I couldn't reproduce flakiness (1.5K runs), I've updated the test to fix a suspected race condition. What seems to be happening: In the `beforeEach` [here](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L477), three rules are created: - one with investigation_fields equal to `['client.address', 'agent.name']` - one with investigation_fields equal to `[]` - one with investigation_fields equal to `{ field_names: ['host.name'] }` Then, in the [test](https://github.com/nikitaindik/kibana/blob/b7b95111e010cc9fba618b625bb6f8c8969de1ec/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts#L506), we read all three rules and check them in that same order. But if the `[]` rule is created on the backend before the `['client.address', 'agent.name']` rule, our first check would fail. Other tests in this file don't expect rules to come in a particular order. Instead, they search for a needed rule in the array. I used the same approach for this flaky test.
A test failed on a tracked branch
First failure: CI Build - main
The text was updated successfully, but these errors were encountered: