Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telemetry][Security Solution] Fix flaky tests #190044

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

szaffarano
Copy link
Contributor

@szaffarano szaffarano commented Aug 7, 2024

Summary

Fixes: #188234 #187719 and #178918

The flakiness was while calculating the Detection Rules task invocations. It could have two different RCs: 1) The code didn't retry in case the task wasn't executed yet, which makes sense in a CI environment, which is slower than a dev environment; 2) The timestamp to filter out requests was calculated after the task was triggered, and if the task is executed fast enough, it could lead to empty responses because of that.

@szaffarano szaffarano requested a review from a team as a code owner August 7, 2024 11:30
@szaffarano szaffarano added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. labels Aug 7, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@szaffarano szaffarano changed the title [Telemetry][Security Solution] Fix flaky test [Telemetry][Security Solution] Fix flaky tests Aug 7, 2024
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@szaffarano szaffarano enabled auto-merge (squash) August 7, 2024 12:51
Copy link
Contributor

@dejadavi-el dejadavi-el left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@szaffarano szaffarano merged commit 358e104 into main Aug 7, 2024
48 checks passed
@szaffarano szaffarano deleted the szaffarano/fix-flaky-test branch August 7, 2024 13:13
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 7, 2024
## Summary

Fixes: elastic#188234
elastic#187719 and
elastic#178918

The flakiness was while calculating the Detection Rules task
invocations. It could have two different RCs: 1) The code didn't retry
in case the task wasn't executed yet, which makes sense in a CI
environment, which is slower than a dev environment; 2) The timestamp to
filter out requests was calculated after the task was triggered, and if
the task is executed fast enough, it could lead to empty responses
because of that.

(cherry picked from commit 358e104)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 7, 2024
)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Telemetry][Security Solution] Fix flaky tests
(#190044)](#190044)

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

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

<!--BACKPORT [{"author":{"name":"Sebastián
Zaffarano","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-08-07T13:13:13Z","message":"[Telemetry][Security
Solution] Fix flaky tests (#190044)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/188234\r\nhttps://github.com/elastic/kibana/issues/187719
and\r\nhttps://github.com//issues/178918\r\n\r\nThe
flakiness was while calculating the Detection Rules task\r\ninvocations.
It could have two different RCs: 1) The code didn't retry\r\nin case the
task wasn't executed yet, which makes sense in a CI\r\nenvironment,
which is slower than a dev environment; 2) The timestamp to\r\nfilter
out requests was calculated after the task was triggered, and if\r\nthe
task is executed fast enough, it could lead to empty
responses\r\nbecause of
that.","sha":"358e104ebcc2bfcfeec3457b2e913d071d27745d","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","v8.15.0","v8.16.0"],"title":"[Telemetry][Security
Solution] Fix flaky
tests","number":190044,"url":"https://github.com/elastic/kibana/pull/190044","mergeCommit":{"message":"[Telemetry][Security
Solution] Fix flaky tests (#190044)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/188234\r\nhttps://github.com/elastic/kibana/issues/187719
and\r\nhttps://github.com//issues/178918\r\n\r\nThe
flakiness was while calculating the Detection Rules task\r\ninvocations.
It could have two different RCs: 1) The code didn't retry\r\nin case the
task wasn't executed yet, which makes sense in a CI\r\nenvironment,
which is slower than a dev environment; 2) The timestamp to\r\nfilter
out requests was calculated after the task was triggered, and if\r\nthe
task is executed fast enough, it could lead to empty
responses\r\nbecause of
that.","sha":"358e104ebcc2bfcfeec3457b2e913d071d27745d"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/190044","number":190044,"mergeCommit":{"message":"[Telemetry][Security
Solution] Fix flaky tests (#190044)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/188234\r\nhttps://github.com/elastic/kibana/issues/187719
and\r\nhttps://github.com//issues/178918\r\n\r\nThe
flakiness was while calculating the Detection Rules task\r\ninvocations.
It could have two different RCs: 1) The code didn't retry\r\nin case the
task wasn't executed yet, which makes sense in a CI\r\nenvironment,
which is slower than a dev environment; 2) The timestamp to\r\nfilter
out requests was calculated after the task was triggered, and if\r\nthe
task is executed fast enough, it could lead to empty
responses\r\nbecause of
that.","sha":"358e104ebcc2bfcfeec3457b2e913d071d27745d"}}]}] BACKPORT-->

Co-authored-by: Sebastián Zaffarano <[email protected]>
@mistic mistic added v8.15.1 and removed v8.15.0 labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.15.1 v8.16.0
Projects
None yet
6 participants