Skip to content

Commit

Permalink
[Security Solution] Fix flaky test for multiline diff algorithm (elas…
Browse files Browse the repository at this point in the history
…tic#201019)

**Fixes: elastic#201014
**Related to:** elastic#199388

## Summary

This PR increases the threshold (time limit) value for the test by 2x
from 500 ms to 1000 ms. Hope it should be enough to eliminate flakiness
on CI.

(cherry picked from commit c9e7820)
  • Loading branch information
banderror committed Nov 20, 2024
1 parent 29209cb commit 476aa4a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ describe('multiLineStringDiffAlgorithm', () => {
const result = multiLineStringDiffAlgorithm(mockVersions);
const endTime = performance.now();

// If the regex merge in this function takes over 500ms, this test fails
// If the regex merge in this function takes over 1 sec, this test fails
// Performance measurements: https://github.com/elastic/kibana/pull/199388
expect(endTime - startTime).toBeLessThan(500);
// 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);

expect(result).toEqual(
expect.objectContaining({
Expand Down

0 comments on commit 476aa4a

Please sign in to comment.