@@ -53,7 +53,6 @@ import {
5353 deleteAllRules ,
5454 deleteAllAlerts ,
5555 waitForRuleFailure ,
56- waitForRulePartialFailure ,
5756 routeWithNamespace ,
5857} from '../../../../../../../common/utils/security_solution' ;
5958import { 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