Delete tasks after test

This commit is contained in:
Mike Cote 2024-10-22 08:58:31 -04:00
parent b86da43bc6
commit 30793c0da4
2 changed files with 10 additions and 0 deletions

View file

@ -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');

View file

@ -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<ConcreteTaskInstance | DeprecatedConcreteTaskInstance>
): Promise<SerializedConcreteTaskInstance> {