diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_manager_integration.js b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_manager_integration.js index 53dfa1b5b204d..c87a5039360b8 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_manager_integration.js +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_manager_integration.js @@ -500,7 +500,7 @@ export default function ({ getService }) { expect(task.status).to.eql('running'); }); - await delay(1000); + await ensureTasksIndexRefreshed(); // first runNow should fail const failedRunNowResult = await runTaskNow({ @@ -522,7 +522,7 @@ export default function ({ getService }) { expect(task.status).to.eql('idle'); }); - await delay(1000); + await ensureTasksIndexRefreshed(); // second runNow should be successful const successfulRunNowResult = runTaskNow({