From 352f992b3c36cdacd21cc495e172d6bff77c11bd Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 6 Nov 2024 05:23:50 +1100 Subject: [PATCH] [8.15] Improves cleanup in spaces data functional test (#198921) (#199022) # Backport This will backport the following commits from `main` to `8.15`: - [Improves cleanup in spaces data functional test (#198921)](https://github.com/elastic/kibana/pull/198921) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Jeramy Soucy --- x-pack/test/functional/apps/spaces/spaces_selection.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/x-pack/test/functional/apps/spaces/spaces_selection.ts b/x-pack/test/functional/apps/spaces/spaces_selection.ts index 113282e5a80d6..d2b1019b9d6ac 100644 --- a/x-pack/test/functional/apps/spaces/spaces_selection.ts +++ b/x-pack/test/functional/apps/spaces/spaces_selection.ts @@ -21,6 +21,7 @@ export default function spaceSelectorFunctionalTests({ 'spaceSelector', ]); const spacesService = getService('spaces'); + const sampleData = getService('sampleData'); describe('Spaces', function () { const testSpacesIds = ['another-space', ...Array.from('123456789', (idx) => `space-${idx}`)]; @@ -158,14 +159,7 @@ export default function spaceSelectorFunctionalTests({ }); after(async () => { - // No need to remove the same sample data in both spaces, the index - // data will be removed in the first call. By feature limitation, - // the created saved objects in the second space will be broken but removed - // when we call esArchiver.unload('x-pack/test/functional/es_archives/spaces'). - await PageObjects.common.navigateToApp('home', { - hash: sampleDataHash, - }); - await PageObjects.home.removeSampleDataSet('logs'); + await sampleData.testResources.removeKibanaSampleData('logs'); await PageObjects.security.forceLogout(); });