Skip to content

Commit

Permalink
Fixing Failing test: Plugin Functional Tests.x-pack/test/plugin_api_i…
Browse files Browse the repository at this point in the history
…ntegration/test_suites/task_manager/task_management·ts - task_manager scheduling and running tasks should disable and reenable task and not run it when runSoon = false (#142749)

* Unskipping test

* Adding some console logs

* Comparing strings

* Setting date beforehand

* Comparing against disabled task

* Reverting unnecessary changes

* Cleanup

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
ymao1 and kibanamachine authored Oct 10, 2022
1 parent 30e482b commit 1da866e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const testHistoryIndex = '.kibana_task_manager_test_result';

// Failing: See https://github.com/elastic/kibana/issues/141002
describe.skip('scheduling and running tasks', () => {
describe('scheduling and running tasks', () => {
beforeEach(async () => {
// clean up before each test
return await supertest.delete('/api/sample_tasks').set('kbn-xsrf', 'xxx').expect(200);
Expand Down Expand Up @@ -697,9 +696,10 @@ export default function ({ getService }: FtrProviderContext) {
// disable the task
await bulkDisable([scheduledTask.id]);

let disabledTask: SerializedConcreteTaskInstance;
await retry.try(async () => {
const task = await currentTask(scheduledTask.id);
expect(task.enabled).to.eql(false);
disabledTask = await currentTask(scheduledTask.id);
expect(disabledTask.enabled).to.eql(false);
});

// re-enable the task
Expand All @@ -709,7 +709,7 @@ export default function ({ getService }: FtrProviderContext) {
const task = await currentTask(scheduledTask.id);

expect(task.enabled).to.eql(true);
expect(Date.parse(task.scheduledAt)).to.eql(Date.parse(scheduledTask.scheduledAt));
expect(Date.parse(task.scheduledAt)).to.eql(Date.parse(disabledTask.scheduledAt));
});
});

Expand Down

0 comments on commit 1da866e

Please sign in to comment.