Skip to content

Conversation

@rylnd
Copy link
Contributor

@rylnd rylnd commented Jun 4, 2025

Summary

This test has failed a few times recently with a
version_conflict_engine_exception, stating explicitly that the documents we're trying to load already exist in elasticsearch. In one case the reason was obvious (the suite was retried), but in another it was not clear why the data was there to cause this exception.

Regardless, adding this sanity check (deleting all the alerts) should ensure that this behavior does not recur.

Closes #219112.

This test has failed a few times recently with a
`version_conflict_engine_exception`, stating explicitly that the
documents we're trying to load already exist in elasticsearch. In one
case the reason was obvious (the suite was retried), but in another it
was not clear why the data was there to cause this exception.

Regardless, adding this sanity check (deleting all the alerts) should
ensure that this behavior does not recur.
@rylnd rylnd self-assigned this Jun 4, 2025
@rylnd rylnd added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Detection Engine Security Solution Detection Engine Area 8.19 candidate labels Jun 4, 2025
@rylnd rylnd marked this pull request as ready for review June 4, 2025 20:35
@rylnd rylnd requested a review from a team as a code owner June 4, 2025 20:35
@rylnd rylnd requested a review from nkhristinin June 4, 2025 20:35
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-engine (Team:Detection Engine)

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8329

[✅] x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/ess.config.ts: 200/200 tests passed.

see run history

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @rylnd

@rylnd rylnd added backport:all-open Backport to all branches that could still receive a release and removed backport:all-open Backport to all branches that could still receive a release backport:skip This PR does not require backporting labels Jun 5, 2025
@rylnd rylnd merged commit 7fe71b3 into elastic:main Jun 5, 2025
26 checks passed
@rylnd rylnd deleted the rylnd/more_robust_alert_insertion branch June 5, 2025 20:05
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 7.17, 8.17, 8.18, 8.19, 9.0

https://github.com/elastic/kibana/actions/runs/15476199813

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 5, 2025
…ding our alerts archive (elastic#222691)

## Summary

This test has [failed a few times
recently](elastic#219112) with a
`version_conflict_engine_exception`, stating explicitly that the
documents we're trying to load already exist in elasticsearch. In one
case the reason was obvious (the suite was retried), but in another it
was not clear why the data was there to cause this exception.

Regardless, adding this sanity check (deleting all the alerts) should
ensure that this behavior does not recur.

Closes elastic#219112.

- [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 7fe71b3)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 5, 2025
…ding our alerts archive (elastic#222691)

## Summary

This test has [failed a few times
recently](elastic#219112) with a
`version_conflict_engine_exception`, stating explicitly that the
documents we're trying to load already exist in elasticsearch. In one
case the reason was obvious (the suite was retried), but in another it
was not clear why the data was there to cause this exception.

Regardless, adding this sanity check (deleting all the alerts) should
ensure that this behavior does not recur.

Closes elastic#219112.

- [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 7fe71b3)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 5, 2025
…ding our alerts archive (elastic#222691)

## Summary

This test has [failed a few times
recently](elastic#219112) with a
`version_conflict_engine_exception`, stating explicitly that the
documents we're trying to load already exist in elasticsearch. In one
case the reason was obvious (the suite was retried), but in another it
was not clear why the data was there to cause this exception.

Regardless, adding this sanity check (deleting all the alerts) should
ensure that this behavior does not recur.

Closes elastic#219112.

- [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 7fe71b3)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 5, 2025
…ding our alerts archive (elastic#222691)

## Summary

This test has [failed a few times
recently](elastic#219112) with a
`version_conflict_engine_exception`, stating explicitly that the
documents we're trying to load already exist in elasticsearch. In one
case the reason was obvious (the suite was retried), but in another it
was not clear why the data was there to cause this exception.

Regardless, adding this sanity check (deleting all the alerts) should
ensure that this behavior does not recur.

Closes elastic#219112.

- [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 7fe71b3)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.17
8.18
8.19
9.0

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 222691

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 5, 2025
…re loading our alerts archive (#222691) (#222893)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Detection Engine][Test Fix] Ensure that alerts are absent before
loading our alerts archive
(#222691)](#222691)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ryland
Herrick","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-05T20:05:06Z","message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Detection
Engine","8.19 candidate","v9.1.0"],"title":"[Detection Engine][Test Fix]
Ensure that alerts are absent before loading our alerts
archive","number":222691,"url":"https://github.com/elastic/kibana/pull/222691","mergeCommit":{"message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222691","number":222691,"mergeCommit":{"message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a"}}]}]
BACKPORT-->

Co-authored-by: Ryland Herrick <[email protected]>
kibanamachine added a commit that referenced this pull request Jun 5, 2025
…ore loading our alerts archive (#222691) (#222892)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Detection Engine][Test Fix] Ensure that alerts are absent before
loading our alerts archive
(#222691)](#222691)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ryland
Herrick","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-05T20:05:06Z","message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Detection
Engine","8.19 candidate","v9.1.0"],"title":"[Detection Engine][Test Fix]
Ensure that alerts are absent before loading our alerts
archive","number":222691,"url":"https://github.com/elastic/kibana/pull/222691","mergeCommit":{"message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222691","number":222691,"mergeCommit":{"message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a"}}]}]
BACKPORT-->

Co-authored-by: Ryland Herrick <[email protected]>
kibanamachine added a commit that referenced this pull request Jun 5, 2025
…ore loading our alerts archive (#222691) (#222890)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Detection Engine][Test Fix] Ensure that alerts are absent before
loading our alerts archive
(#222691)](#222691)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ryland
Herrick","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-05T20:05:06Z","message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Detection
Engine","8.19 candidate","v9.1.0"],"title":"[Detection Engine][Test Fix]
Ensure that alerts are absent before loading our alerts
archive","number":222691,"url":"https://github.com/elastic/kibana/pull/222691","mergeCommit":{"message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222691","number":222691,"mergeCommit":{"message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a"}}]}]
BACKPORT-->

Co-authored-by: Ryland Herrick <[email protected]>
kibanamachine added a commit that referenced this pull request Jun 5, 2025
…ore loading our alerts archive (#222691) (#222891)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Detection Engine][Test Fix] Ensure that alerts are absent before
loading our alerts archive
(#222691)](#222691)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ryland
Herrick","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-05T20:05:06Z","message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Detection
Engine","8.19 candidate","v9.1.0"],"title":"[Detection Engine][Test Fix]
Ensure that alerts are absent before loading our alerts
archive","number":222691,"url":"https://github.com/elastic/kibana/pull/222691","mergeCommit":{"message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222691","number":222691,"mergeCommit":{"message":"[Detection
Engine][Test Fix] Ensure that alerts are absent before loading our
alerts archive (#222691)\n\n## Summary\n\nThis test has [failed a few
times\nrecently](#219112) with
a\n`version_conflict_engine_exception`, stating explicitly that
the\ndocuments we're trying to load already exist in elasticsearch. In
one\ncase the reason was obvious (the suite was retried), but in another
it\nwas not clear why the data was there to cause this
exception.\n\nRegardless, adding this sanity check (deleting all the
alerts) should\nensure that this behavior does not recur.\n\nCloses
#219112.\n\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed\n([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))\n-
[x] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7fe71b3f4ee4b68e22bb424aa7b8ccc2e3c40f1a"}}]}]
BACKPORT-->

Co-authored-by: Ryland Herrick <[email protected]>
pmuellr pushed a commit to pmuellr/kibana that referenced this pull request Jun 11, 2025
…ding our alerts archive (elastic#222691)

## Summary

This test has [failed a few times
recently](elastic#219112) with a
`version_conflict_engine_exception`, stating explicitly that the
documents we're trying to load already exist in elasticsearch. In one
case the reason was obvious (the suite was retried), but in another it
was not clear why the data was there to cause this exception.

Regardless, adding this sanity check (deleting all the alerts) should
ensure that this behavior does not recur.

Closes elastic#219112.


- [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
…ding our alerts archive (elastic#222691)

## Summary

This test has [failed a few times
recently](elastic#219112) with a
`version_conflict_engine_exception`, stating explicitly that the
documents we're trying to load already exist in elasticsearch. In one
case the reason was obvious (the suite was retried), but in another it
was not clear why the data was there to cause this exception.

Regardless, adding this sanity check (deleting all the alerts) should
ensure that this behavior does not recur.

Closes elastic#219112.


- [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([200x](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8329))
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment