Skip to content

Commit

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

**Fixes: #201014
**Related to:** #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.
  • Loading branch information
banderror authored Nov 20, 2024
1 parent 4ffdb35 commit c9e7820
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 c9e7820

Please sign in to comment.