Skip to content

Commit 8e0561a

Browse files
authored
[Security Solution] Fix flaky test for multiLineStringDiffAlgorithm (elastic#205038)
**Fixes: elastic#205014 ## Summary This test on CI runs at least 10x slower than locally, and apparently even 1000ms timeout is not enough. Bumping it to 2000ms and hopefully that will be it. Not sure if it makes sense to bump it even higher, because we need this threshold to be reasonably low, and more than 2 seconds doesn't sound low for local test runs. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed
1 parent 29984c4 commit 8e0561a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ describe('multiLineStringDiffAlgorithm', () => {
174174
const result = multiLineStringDiffAlgorithm(mockVersions);
175175
const endTime = performance.now();
176176

177-
// If the regex merge in this function takes over 1 sec, this test fails
177+
// If the regex merge in this function takes over 2 sec, this test fails
178178
// Performance measurements: https://github.com/elastic/kibana/pull/199388
179179
// NOTE: despite the fact that this test runs in ~50ms locally, on CI it
180-
// runs slower and can be flaky even with a 500ms threshold.
181-
expect(endTime - startTime).toBeLessThan(1000);
180+
// runs ~10x slower and can be flaky even with a 1000ms threshold.
181+
expect(endTime - startTime).toBeLessThan(2000);
182182

183183
expect(result).toEqual(
184184
expect.objectContaining({

0 commit comments

Comments
 (0)