Skip to content

Commit 06f444a

Browse files
[9.0] [Security Solution] [Detections] Use preview route for testing EQL shard failure (#214284) (#215166)
# Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] [Detections] Use preview route for testing EQL shard failure (#214284)](#214284) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Devin W. Hurley","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-19T13:12:38Z","message":"[Security Solution] [Detections] Use preview route for testing EQL shard failure (#214284)\n\nfixes flakey test https://github.com/elastic/kibana/issues/209024\n- [x] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed","sha":"cd491c34e79b65641e00f95cf8120557a407a338","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","release_note:skip","v9.0.0","Team:Detection Engine","backport:version","v9.1.0","v9.0.1"],"title":"[Security Solution] [Detections] Use preview route for testing EQL shard failure","number":214284,"url":"https://github.com/elastic/kibana/pull/214284","mergeCommit":{"message":"[Security Solution] [Detections] Use preview route for testing EQL shard failure (#214284)\n\nfixes flakey test https://github.com/elastic/kibana/issues/209024\n- [x] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed","sha":"cd491c34e79b65641e00f95cf8120557a407a338"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214284","number":214284,"mergeCommit":{"message":"[Security Solution] [Detections] Use preview route for testing EQL shard failure (#214284)\n\nfixes flakey test https://github.com/elastic/kibana/issues/209024\n- [x] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed","sha":"cd491c34e79b65641e00f95cf8120557a407a338"}}]}] BACKPORT--> Co-authored-by: Devin W. Hurley <[email protected]>
1 parent 6c0c502 commit 06f444a

File tree

1 file changed

+8
-18
lines changed
  • x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier

1 file changed

+8
-18
lines changed

x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/eql.ts

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import {
5353
deleteAllRules,
5454
deleteAllAlerts,
5555
waitForRuleFailure,
56-
waitForRulePartialFailure,
5756
routeWithNamespace,
5857
} from '../../../../../../../common/utils/security_solution';
5958
import { FtrProviderContext } from '../../../../../../ftr_provider_context';
@@ -247,32 +246,23 @@ export default ({ getService }: FtrProviderContext) => {
247246
).eql(1);
248247
});
249248

250-
// Failing: See https://github.com/elastic/kibana/issues/209024
251-
it.skip('parses shard failures for EQL event query', async () => {
249+
it('parses shard failures for EQL event query', async () => {
252250
await esArchiver.load(packetBeatPath);
253251
const rule: EqlRuleCreateProps = {
254252
...getEqlRuleForAlertTesting(['auditbeat-*', 'packetbeat-*']),
255253
query: 'any where agent.type == "packetbeat" or broken == 1',
256254
};
257255
await setBrokenRuntimeField({ es, index: 'auditbeat-*' });
258-
const createdRule = await createRule(supertest, log, rule);
259-
const createdRuleId = createdRule.id;
260-
await waitForRulePartialFailure({ supertest, log, id: createdRuleId });
261-
const route = routeWithNamespace(DETECTION_ENGINE_RULES_URL);
262-
const response = await supertest
263-
.get(route)
264-
.set('kbn-xsrf', 'true')
265-
.set('elastic-api-version', '2023-10-31')
266-
.query({ id: createdRule.id })
267-
.expect(200);
268-
269-
const ruleResponse = response.body;
256+
const { logs } = await previewRule({ supertest, rule });
270257
expect(
271-
ruleResponse.execution_summary.last_execution.message.includes(
272-
'The EQL event query was only executed on the available shards. The query failed to run successfully on the following shards:'
258+
logs.some((previewLog) =>
259+
previewLog.warnings.some((warning) =>
260+
warning.includes(
261+
'The EQL event query was only executed on the available shards. The query failed to run successfully on the following shards:'
262+
)
263+
)
273264
)
274265
).eql(true);
275-
276266
await unsetBrokenRuntimeField({ es, index: 'auditbeat-*' });
277267
await esArchiver.unload(packetBeatPath);
278268
});

0 commit comments

Comments
 (0)