Skip to content

Commit c40869b

Browse files
committed
change query to force search of 'bad' shard
1 parent 10f9223 commit c40869b

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

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

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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,18 @@ export default ({ getService }: FtrProviderContext) => {
249249

250250
it('parses shard failures for EQL event query', async () => {
251251
await esArchiver.load(packetBeatPath);
252+
await setBrokenRuntimeField({ es, index: 'packetbeat-*' });
253+
254+
// sometimes we would hit max signals on the good shard
255+
// and never search the shard with the bad runtime field
256+
// by changing the agent.type to be packetbeat
257+
// we ensure that both shards are searched
258+
// which I believe was the cause of the test being flakey.
252259
const rule: EqlRuleCreateProps = {
253260
...getEqlRuleForAlertTesting(['auditbeat-*', 'packetbeat-*']),
254-
query: 'any where agent.type == "packetbeat" or broken == 1',
261+
query: 'any where agent.type == "packetbeat" and broken == 1',
255262
};
256-
await setBrokenRuntimeField({ es, index: 'auditbeat-*' });
257263
const { logs } = await previewRule({ supertest, rule });
258-
259264
expect(logs).toEqual(
260265
expect.arrayContaining([
261266
expect.objectContaining({
@@ -267,7 +272,7 @@ export default ({ getService }: FtrProviderContext) => {
267272
}),
268273
])
269274
);
270-
await unsetBrokenRuntimeField({ es, index: 'auditbeat-*' });
275+
await unsetBrokenRuntimeField({ es, index: 'packetbeat-*' });
271276
await esArchiver.unload(packetBeatPath);
272277
});
273278

0 commit comments

Comments
 (0)