Skip to content

Commit

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

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security Solution] Fix flaky test for multiline diff algorithm
(elastic#201019)](elastic#201019)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Georgii
Gorbachev","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-20T21:12:02Z","message":"[Security
Solution] Fix flaky test for multiline diff algorithm
(elastic#201019)\n\n**Fixes:
https://github.com/elastic/kibana/issues/201014**\r\n**Related to:**
https://github.com/elastic/kibana/pull/199388\r\n\r\n##
Summary\r\n\r\nThis PR increases the threshold (time limit) value for
the test by 2x\r\nfrom 500 ms to 1000 ms. Hope it should be enough to
eliminate flakiness\r\non
CI.","sha":"c9e782030a768da471616d626096eb325e12c38c","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.17.0","v8.16.1"],"title":"[Security
Solution] Fix flaky test for multiline diff
algorithm","number":201019,"url":"https://github.com/elastic/kibana/pull/201019","mergeCommit":{"message":"[Security
Solution] Fix flaky test for multiline diff algorithm
(elastic#201019)\n\n**Fixes:
https://github.com/elastic/kibana/issues/201014**\r\n**Related to:**
https://github.com/elastic/kibana/pull/199388\r\n\r\n##
Summary\r\n\r\nThis PR increases the threshold (time limit) value for
the test by 2x\r\nfrom 500 ms to 1000 ms. Hope it should be enough to
eliminate flakiness\r\non
CI.","sha":"c9e782030a768da471616d626096eb325e12c38c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201019","number":201019,"mergeCommit":{"message":"[Security
Solution] Fix flaky test for multiline diff algorithm
(elastic#201019)\n\n**Fixes:
https://github.com/elastic/kibana/issues/201014**\r\n**Related to:**
https://github.com/elastic/kibana/pull/199388\r\n\r\n##
Summary\r\n\r\nThis PR increases the threshold (time limit) value for
the test by 2x\r\nfrom 500 ms to 1000 ms. Hope it should be enough to
eliminate flakiness\r\non
CI.","sha":"c9e782030a768da471616d626096eb325e12c38c"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Georgii Gorbachev <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent e76d483 commit a517ad2
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 a517ad2

Please sign in to comment.