From 07a4287ddd5935da3496aa1dd61fa1ab486a8d38 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 24 Dec 2024 00:20:58 +1100 Subject: [PATCH] [8.16] [Security Solution] Fix flaky test for multiLineStringDiffAlgorithm (#205038) (#205081) # Backport This will backport the following commits from `main` to `8.16`: - [[Security Solution] Fix flaky test for multiLineStringDiffAlgorithm (#205038)](https://github.com/elastic/kibana/pull/205038) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Georgii Gorbachev --- .../algorithms/multi_line_string_diff_algorithm.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts index 8f0b3586066fa..4ecb828a77d4c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts @@ -174,11 +174,11 @@ describe('multiLineStringDiffAlgorithm', () => { const result = multiLineStringDiffAlgorithm(mockVersions); const endTime = performance.now(); - // If the regex merge in this function takes over 1 sec, this test fails + // If the regex merge in this function takes over 2 sec, this test fails // Performance measurements: https://github.com/elastic/kibana/pull/199388 // NOTE: despite the fact that this test runs in ~50ms locally, on CI it - // runs slower and can be flaky even with a 500ms threshold. - expect(endTime - startTime).toBeLessThan(1000); + // runs ~10x slower and can be flaky even with a 1000ms threshold. + expect(endTime - startTime).toBeLessThan(2000); expect(result).toEqual( expect.objectContaining({