-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Archive Migration] batch 2 of removing es_archives/empty_kibana #138208
Conversation
…-ref HEAD~1..HEAD --fix'
…remove_empty_kibana_2
There seem to be some tests here which are creating spaces and not cleaning them up at the end, which causes a failure when the next test tries to create a space which already exists. I don't know these tests but it seems like these should be matching pairs of setupSpacesAndUsers and tearDown? This could be a case where es_archives/empty_kibana would have wiped out everything in the .kibana index including spaces but cleanStandardList doesn't do that.
|
@elasticmachine merge upstream |
merge conflict between base and head |
@elasticmachine merge upstream |
Pinging @elastic/fleet (Team:Fleet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fleet changes
const { data, status, statusText } = await axios.delete(`/api/spaces/space/${spaceId}`); | ||
|
||
if (status !== 204) { | ||
throw new Error( | ||
log.debug( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to call this out for reviewers. The issue here is that some tests are still unloading an es_archive which contains spaces. This method was failing if trying to delete a space which has already been removed by unloading the es_archive. It appears that this is primarily used as a tearDown step and not any tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah my eyebrow raised on this one at first, but I concur. Good call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResponseOps changes LGTM
Though the ResponseOps changes LGTM, I peeked at kibana/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts Lines 223 to 230 in 81d7a6f
You're not supposed to delete alerting rule SO's (type: While this is likely quite survivable today, since typically nothing bad happens except for excessive logging, we have seen some scenarios in the field of this affecting task manager health (it starts to complain about the failure rate if you delete a lot like this), so it would really be best NOT to delete the rule SO's, just by themselves. It will also cause these "zombie" tasks to delay execution of rules that are currently under test, generally making them run longer, or worse case fail with their own sorts of "timeouts". I feel like perhaps we can have a way to do alternate delete processing for some of the types, so instead of deleting the rule SO via SO APIs, we'd delete it via the alerting APIs, which delete both SO docs. |
If rules are defined within a space, does deleting the space take care of the task manager index SOs? For rules not in a space, it sounds like we would have to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ML changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enterprise Search changes look good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onboarding lifecycle management changes lgtm
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
…stic#138208) * replace es_archives/empty_kibana with kibanaServer.savedObjects.cleanStandardList * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * add missing kibanaServer * add a tearDown * revert changes that don't pass * revert fleet_setup, delete spaces in tearDown * Don't fail on deleting spaces * revert file for failing test Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit f2c20b7)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…8208) (#139318) * replace es_archives/empty_kibana with kibanaServer.savedObjects.cleanStandardList * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * add missing kibanaServer * add a tearDown * revert changes that don't pass * revert fleet_setup, delete spaces in tearDown * Don't fail on deleting spaces * revert file for failing test Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit f2c20b7) Co-authored-by: Lee Drengenberg <lee.drengenberg@elastic.co>
…stic#138208) * replace es_archives/empty_kibana with kibanaServer.savedObjects.cleanStandardList * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * add missing kibanaServer * add a tearDown * revert changes that don't pass * revert fleet_setup, delete spaces in tearDown * Don't fail on deleting spaces * revert file for failing test Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Part of Meta issue: #102552
This PR removes the use of es_archives/empty_kibana and replaced it with calls to kibanaServer.savedObjects.cleanStandardList. Similar to this PR #138189
WARNING: I should note that there is a difference between
esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); (which I think deletes the entire .kibana index) and
kibanaServer.savedObjects.cleanStandardList(); (which can only delete savedObjects of types supported by the Saved Object API in the DEFAULT SPACE). There might be some types of saved objects which are not deleted. The full set we delete are here https://github.com/elastic/kibana/blob/main/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts#L225 And saved objects in other spaces wouldn't be deleted. I mostly used find/replace to generate this PR and didn't review all the tests in detail. But the tests passed! The fact that our tests are broken up into so many separate configs probably helps with the isolation of tests.
I find that generally tests that created a space also already had an after method that deletes the space (and everything in it).