From 1dbb2737405588af1262ad76be24d08917d0f725 Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Mon, 17 Jul 2023 12:07:56 +0100 Subject: [PATCH] cleaning up calls to cleanMLSavedObjects --- .../apis/ml/anomaly_detectors/create_with_spaces.ts | 2 +- .../apis/ml/anomaly_detectors/forecast_with_spaces.ts | 2 +- .../apis/ml/anomaly_detectors/get_stats_with_spaces.ts | 2 +- .../apis/ml/anomaly_detectors/get_with_spaces.ts | 2 +- .../apis/ml/data_frame_analytics/get_spaces.ts | 2 +- .../apis/ml/data_frame_analytics/jobs_exist_spaces.ts | 2 +- .../apis/ml/data_frame_analytics/start_spaces.ts | 2 +- .../apis/ml/data_frame_analytics/stop_spaces.ts | 2 +- .../apis/ml/data_frame_analytics/update_spaces.ts | 2 +- .../apis/ml/datafeeds/get_stats_with_spaces.ts | 2 +- .../api_integration/apis/ml/datafeeds/get_with_spaces.ts | 2 +- x-pack/test/api_integration/apis/ml/datafeeds/update.ts | 2 +- x-pack/test/api_integration/apis/ml/jobs/jobs.ts | 5 ++++- .../api_integration/apis/ml/jobs/jobs_exist_spaces.ts | 2 +- .../api_integration/apis/ml/jobs/jobs_summary_spaces.ts | 2 +- .../test/api_integration/apis/ml/management/get_list.ts | 2 +- .../api_integration/apis/ml/results/get_anomaly_search.ts | 4 ++-- .../apis/ml/saved_objects/can_delete_job.ts | 2 +- .../apis/ml/saved_objects/can_delete_trained_model.ts | 2 +- .../apis/ml/saved_objects/get_jobs_spaces.ts | 2 +- .../apis/ml/saved_objects/get_trained_model_spaces.ts | 2 +- .../apis/ml/saved_objects/initialize_trained_models.ts | 2 +- .../apis/ml/saved_objects/remove_from_current_space.ts | 4 ++-- .../test/api_integration/apis/ml/saved_objects/status.ts | 2 +- .../api_integration/apis/ml/saved_objects/sync_jobs.ts | 2 +- .../apis/ml/saved_objects/sync_trained_models.ts | 2 +- .../ml/short_tests/notifications/notification_list.ts | 2 +- .../apps/ml/stack_management_jobs/manage_spaces.ts | 8 +++++++- 28 files changed, 39 insertions(+), 30 deletions(-) diff --git a/x-pack/test/api_integration/apis/ml/anomaly_detectors/create_with_spaces.ts b/x-pack/test/api_integration/apis/ml/anomaly_detectors/create_with_spaces.ts index af9278a337f53..a3a20966d1ae8 100644 --- a/x-pack/test/api_integration/apis/ml/anomaly_detectors/create_with_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/anomaly_detectors/create_with_spaces.ts @@ -30,7 +30,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should create a job in the current space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/anomaly_detectors/forecast_with_spaces.ts b/x-pack/test/api_integration/apis/ml/anomaly_detectors/forecast_with_spaces.ts index ea2f2bd771839..1176452408762 100644 --- a/x-pack/test/api_integration/apis/ml/anomaly_detectors/forecast_with_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/anomaly_detectors/forecast_with_spaces.ts @@ -58,7 +58,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should not forecast for a job that has not been opened', async () => { diff --git a/x-pack/test/api_integration/apis/ml/anomaly_detectors/get_stats_with_spaces.ts b/x-pack/test/api_integration/apis/ml/anomaly_detectors/get_stats_with_spaces.ts index e946fd36a1c44..6a82281d852ac 100644 --- a/x-pack/test/api_integration/apis/ml/anomaly_detectors/get_stats_with_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/anomaly_detectors/get_stats_with_spaces.ts @@ -58,7 +58,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should fail with non-existing job', async () => { diff --git a/x-pack/test/api_integration/apis/ml/anomaly_detectors/get_with_spaces.ts b/x-pack/test/api_integration/apis/ml/anomaly_detectors/get_with_spaces.ts index 01a190dc0e15a..908ee1728e814 100644 --- a/x-pack/test/api_integration/apis/ml/anomaly_detectors/get_with_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/anomaly_detectors/get_with_spaces.ts @@ -58,7 +58,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should fail with non-existing job', async () => { diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/get_spaces.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/get_spaces.ts index 69a67df234f1f..e294ddb51d7ea 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/get_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/get_spaces.ts @@ -80,7 +80,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should only list jobs from same space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/jobs_exist_spaces.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/jobs_exist_spaces.ts index 67b02afb7e89a..73b609961fc58 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/jobs_exist_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/jobs_exist_spaces.ts @@ -68,7 +68,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should find single job from same space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/start_spaces.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/start_spaces.ts index a97bbe278a7a7..6f7d23da124f8 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/start_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/start_spaces.ts @@ -73,7 +73,7 @@ export default ({ getService }: FtrProviderContext) => { await ml.api.cleanMlIndices(); await ml.api.deleteIndices(space1JobDestIndex); await ml.api.deleteIndices(space2JobDestIndex); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should start job from same space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/stop_spaces.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/stop_spaces.ts index 5979c6d3e953b..9f86a9f136c56 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/stop_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/stop_spaces.ts @@ -71,7 +71,7 @@ export default ({ getService }: FtrProviderContext) => { await ml.api.deleteIndices(`user-${jobIdSpace3}`); await ml.api.deleteIndices(`user-${jobIdSpace4}`); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace3, idSpace4]); + await ml.testResources.cleanMLSavedObjects(); }); it('should stop job from same space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/update_spaces.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/update_spaces.ts index e1e2f16619aa9..6b62502827c6b 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/update_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/update_spaces.ts @@ -69,7 +69,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should update job from same space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/datafeeds/get_stats_with_spaces.ts b/x-pack/test/api_integration/apis/ml/datafeeds/get_stats_with_spaces.ts index 7b3f3079ef90c..0b74e67278943 100644 --- a/x-pack/test/api_integration/apis/ml/datafeeds/get_stats_with_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/datafeeds/get_stats_with_spaces.ts @@ -59,7 +59,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should fail with non-existing datafeed', async () => { diff --git a/x-pack/test/api_integration/apis/ml/datafeeds/get_with_spaces.ts b/x-pack/test/api_integration/apis/ml/datafeeds/get_with_spaces.ts index 7a4d9814e3cc6..152f8ceba28e0 100644 --- a/x-pack/test/api_integration/apis/ml/datafeeds/get_with_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/datafeeds/get_with_spaces.ts @@ -57,7 +57,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should fail with non-existing datafeed', async () => { diff --git a/x-pack/test/api_integration/apis/ml/datafeeds/update.ts b/x-pack/test/api_integration/apis/ml/datafeeds/update.ts index 794ddab044bbf..dabf2deb1de67 100644 --- a/x-pack/test/api_integration/apis/ml/datafeeds/update.ts +++ b/x-pack/test/api_integration/apis/ml/datafeeds/update.ts @@ -57,7 +57,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should update datafeed with correct space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/jobs/jobs.ts b/x-pack/test/api_integration/apis/ml/jobs/jobs.ts index b95e054151c59..a6c423bd8474d 100644 --- a/x-pack/test/api_integration/apis/ml/jobs/jobs.ts +++ b/x-pack/test/api_integration/apis/ml/jobs/jobs.ts @@ -16,6 +16,7 @@ export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); const supertest = getService('supertestWithoutAuth'); const ml = getService('ml'); + const spacesService = getService('spaces'); const idSpace1 = 'space1'; @@ -95,6 +96,7 @@ export default ({ getService }: FtrProviderContext) => { before(async () => { await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote'); await ml.testResources.setKibanaTimeZoneToUTC(); + await spacesService.create({ id: idSpace1, name: 'space_one', disabledFeatures: [] }); for (const job of testSetupJobConfigs) { await ml.api.createAnomalyDetectionJob(job); @@ -123,8 +125,9 @@ export default ({ getService }: FtrProviderContext) => { }); after(async () => { + await spacesService.delete(idSpace1); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1]); + await ml.testResources.cleanMLSavedObjects(); }); it('returns expected list of combined jobs with stats in default space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/jobs/jobs_exist_spaces.ts b/x-pack/test/api_integration/apis/ml/jobs/jobs_exist_spaces.ts index 7cb147eeea5a0..023b367bd8cfd 100644 --- a/x-pack/test/api_integration/apis/ml/jobs/jobs_exist_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/jobs/jobs_exist_spaces.ts @@ -54,7 +54,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should find single job from same space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/jobs/jobs_summary_spaces.ts b/x-pack/test/api_integration/apis/ml/jobs/jobs_summary_spaces.ts index b55bb482d809e..a650b0a1d1951 100644 --- a/x-pack/test/api_integration/apis/ml/jobs/jobs_summary_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/jobs/jobs_summary_spaces.ts @@ -49,7 +49,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should list job from same space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/management/get_list.ts b/x-pack/test/api_integration/apis/ml/management/get_list.ts index 78ad609a03c73..9cecacfa3da2c 100644 --- a/x-pack/test/api_integration/apis/ml/management/get_list.ts +++ b/x-pack/test/api_integration/apis/ml/management/get_list.ts @@ -90,7 +90,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it(`should get AD jobs for space ${idSpace1}`, async () => { diff --git a/x-pack/test/api_integration/apis/ml/results/get_anomaly_search.ts b/x-pack/test/api_integration/apis/ml/results/get_anomaly_search.ts index e89e610c0b629..9238fe5cce1c6 100644 --- a/x-pack/test/api_integration/apis/ml/results/get_anomaly_search.ts +++ b/x-pack/test/api_integration/apis/ml/results/get_anomaly_search.ts @@ -68,10 +68,10 @@ export default ({ getService }: FtrProviderContext) => { }); after(async () => { - await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); + await ml.api.cleanMlIndices(); + await ml.testResources.cleanMLSavedObjects(); }); it('should see results in current space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/can_delete_job.ts b/x-pack/test/api_integration/apis/ml/saved_objects/can_delete_job.ts index 229ce187cdd9d..bce96de95a643 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/can_delete_job.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/can_delete_job.ts @@ -76,7 +76,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('job in individual spaces, single space user can only untag', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/can_delete_trained_model.ts b/x-pack/test/api_integration/apis/ml/saved_objects/can_delete_trained_model.ts index f36cfc99bd8b9..eeb07b1b67b2d 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/can_delete_trained_model.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/can_delete_trained_model.ts @@ -83,7 +83,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('model in individual spaces, single space user can only untag', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/get_jobs_spaces.ts b/x-pack/test/api_integration/apis/ml/saved_objects/get_jobs_spaces.ts index 3222988693f7f..df539b07e4895 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/get_jobs_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/get_jobs_spaces.ts @@ -64,7 +64,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should list all jobs for user with access to all spaces', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/get_trained_model_spaces.ts b/x-pack/test/api_integration/apis/ml/saved_objects/get_trained_model_spaces.ts index 9981a07def684..834d214a9bb05 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/get_trained_model_spaces.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/get_trained_model_spaces.ts @@ -56,7 +56,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should list all trained models for user with access to all spaces', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/initialize_trained_models.ts b/x-pack/test/api_integration/apis/ml/saved_objects/initialize_trained_models.ts index 59ebf66e12e75..bc7f4b100c28d 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/initialize_trained_models.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/initialize_trained_models.ts @@ -92,7 +92,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should initialize trained models and inherit job spaces', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/remove_from_current_space.ts b/x-pack/test/api_integration/apis/ml/saved_objects/remove_from_current_space.ts index 86e0d0a8a3274..9cf0f50a8cbb7 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/remove_from_current_space.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/remove_from_current_space.ts @@ -69,10 +69,10 @@ export default ({ getService }: FtrProviderContext) => { }); after(async () => { - await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); + await ml.api.cleanMlIndices(); + await ml.testResources.cleanMLSavedObjects(); }); it('should remove AD job from current space', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/status.ts b/x-pack/test/api_integration/apis/ml/saved_objects/status.ts index c8941b273ea03..ff6ca3792de93 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/status.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/status.ts @@ -69,7 +69,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should list jobs and saved objects', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/sync_jobs.ts b/x-pack/test/api_integration/apis/ml/saved_objects/sync_jobs.ts index cf1b708328b4b..d855005a10c83 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/sync_jobs.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/sync_jobs.ts @@ -67,7 +67,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should sync datafeeds and saved objects', async () => { diff --git a/x-pack/test/api_integration/apis/ml/saved_objects/sync_trained_models.ts b/x-pack/test/api_integration/apis/ml/saved_objects/sync_trained_models.ts index d8a1bb647dc43..33c5da4d2e01c 100644 --- a/x-pack/test/api_integration/apis/ml/saved_objects/sync_trained_models.ts +++ b/x-pack/test/api_integration/apis/ml/saved_objects/sync_trained_models.ts @@ -79,7 +79,7 @@ export default ({ getService }: FtrProviderContext) => { await spacesService.delete(idSpace1); await spacesService.delete(idSpace2); await ml.api.cleanMlIndices(); - await ml.testResources.cleanMLSavedObjects([idSpace1, idSpace2]); + await ml.testResources.cleanMLSavedObjects(); }); it('should sync trained model saved objects', async () => { diff --git a/x-pack/test/functional/apps/ml/short_tests/notifications/notification_list.ts b/x-pack/test/functional/apps/ml/short_tests/notifications/notification_list.ts index 23fb1c1c9f67e..062b2809c375d 100644 --- a/x-pack/test/functional/apps/ml/short_tests/notifications/notification_list.ts +++ b/x-pack/test/functional/apps/ml/short_tests/notifications/notification_list.ts @@ -52,8 +52,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await ml.api.deleteAnomalyDetectionJobES(jobId); } await spacesService.delete(idSpace1); - await ml.testResources.cleanMLSavedObjects([idSpace1]); await ml.api.cleanMlIndices(); + await ml.testResources.cleanMLSavedObjects(); await ml.testResources.deleteIndexPatternByTitle('ft_farequote'); }); diff --git a/x-pack/test/functional/apps/ml/stack_management_jobs/manage_spaces.ts b/x-pack/test/functional/apps/ml/stack_management_jobs/manage_spaces.ts index 7df79d45174e7..4055cd00f7cb9 100644 --- a/x-pack/test/functional/apps/ml/stack_management_jobs/manage_spaces.ts +++ b/x-pack/test/functional/apps/ml/stack_management_jobs/manage_spaces.ts @@ -114,6 +114,12 @@ export default function ({ getService }: FtrProviderContext) { await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); await ml.testResources.createIndexPatternIfNeeded('ft_ihp_outlier', '@timestamp'); + await spacesService.create({ + id: spaceIds.idSpace1, + name: 'space_one', + disabledFeatures: [], + }); + await ml.testResources.setKibanaTimeZoneToUTC(); await ml.securityUI.loginAsMlPowerUser(); @@ -135,8 +141,8 @@ export default function ({ getService }: FtrProviderContext) { await spacesService.delete(spaceId); } } - await ml.testResources.cleanMLSavedObjects([spaceIds.idSpaceDefault, spaceIds.idSpace1]); await ml.api.cleanMlIndices(); + await ml.testResources.cleanMLSavedObjects(); await ml.testResources.deleteIndexPatternByTitle('ft_farequote'); await ml.testResources.deleteIndexPatternByTitle('ft_ihp_outlier'); });