Skip to content

[8.12] [Security Solution] Add retryIfConflict util for 409 conflicts in Integration tests (#174185)#174762

Merged
jpdjere merged 4 commits intoelastic:8.12from
jpdjere:backport/8.12/pr-174185
Jan 15, 2024
Merged

[8.12] [Security Solution] Add retryIfConflict util for 409 conflicts in Integration tests (#174185)#174762
jpdjere merged 4 commits intoelastic:8.12from
jpdjere:backport/8.12/pr-174185

Conversation

@jpdjere
Copy link
Copy Markdown
Contributor

@jpdjere jpdjere commented Jan 12, 2024

Backport

This will backport the following commits from main to 8.12:

Questions ?

Please refer to the Backport tool documentation

… Integration tests (elastic#174185)

## Summary

Fixes: elastic#171428

**NOTE: the test where this was reported wasn't skipped, so this PR does
not unskip any tests.** However, the Flaky Test Runs help us determine
that the issue is no longer reproducible.

The `deleteAllPrebuiltRuleAssets` utility reported a `409 Conflict`,
presumably from `security-rule` assets that were attempted to be deleted
while they were being updated by a parallel process.

This PR wraps the `es.deleteByQuery` calls in the utils
`deleteAllPrebuiltRuleAssets` and `deleteAllTimelines` with a new
`retryIfConflict` helper, that will retry the operation if the ES
request fails with a `409`.

## Flaky test run

`bundled_prebuilt_rules_package` - **ESS** and **Serverless**:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4790

`large_prebuilt_rules_package` - **ESS** and **Serverless**:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4791

`update_prebuilt_rules_package` - **ESS** and **Serverless**:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4792

`management` - **ESS** and **Serverless**:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4793

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit b8c7306)

# Conflicts:
#	x-pack/test/security_solution_api_integration/package.json
@jpdjere jpdjere added the backport This PR is a backport of another PR label Jan 12, 2024
@jpdjere jpdjere enabled auto-merge (squash) January 12, 2024 14:19
@jpdjere jpdjere self-assigned this Jan 12, 2024
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @jpdjere

@jpdjere jpdjere merged commit 24733e5 into elastic:8.12 Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants