From 30793c0da4e220bf16a6bfd9d6069834eeacae08 Mon Sep 17 00:00:00 2001 From: Mike Cote Date: Tue, 22 Oct 2024 08:58:31 -0400 Subject: [PATCH] Delete tasks after test --- .../test_suites/task_manager/health_route.ts | 5 +++++ .../task_manager/task_management_removed_types.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/health_route.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/health_route.ts index 241bd8adcd40d..8225de01034bb 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/health_route.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/health_route.ts @@ -125,6 +125,11 @@ export default function ({ getService }: FtrProviderContext) { const monitoredAggregatedStatsRefreshRate = 5000; describe('health', () => { + afterEach(async () => { + // clean up after each test + return await supertest.delete('/api/sample_tasks').set('kbn-xsrf', 'xxx').expect(200); + }); + it('should return basic configuration of task manager', async () => { const health = await getHealth(); expect(health.status).to.eql('OK'); diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management_removed_types.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management_removed_types.ts index 5c7ef55577861..aae90a52572c7 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management_removed_types.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management_removed_types.ts @@ -56,6 +56,11 @@ export default function ({ getService }: FtrProviderContext) { await esArchiver.unload('x-pack/test/functional/es_archives/task_manager_removed_types'); }); + afterEach(async () => { + // clean up after each test + return await request.delete('/api/sample_tasks').set('kbn-xsrf', 'xxx').expect(200); + }); + function scheduleTask( task: Partial ): Promise {