From 9fc6e0536f0a8505002aa94c0a05a756a820ec69 Mon Sep 17 00:00:00 2001 From: Ying Mao Date: Tue, 23 Feb 2021 21:39:22 -0500 Subject: [PATCH] Adding comment --- .../security_and_spaces/tests/alerting/rbac_legacy.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/rbac_legacy.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/rbac_legacy.ts index 942755d89dbd71..3db35653747400 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/rbac_legacy.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/rbac_legacy.ts @@ -144,6 +144,11 @@ export default function alertTests({ getService }: FtrProviderContext) { } async function resetTaskStatus(alertId: string) { + // occasionally when the task manager starts running while the alert saved objects + // are mid-migration, the task will fail and set its status to "failed". this prevents + // the alert from running ever again and downstream tasks that depend on successful alert + // execution will fail. this ensures the task status is set to "idle" so the + // task manager will continue claiming and executing it. await supertest .put(`${getUrlPrefix(space.id)}/api/alerts_fixture/${alertId}/reset_task_status`) .set('kbn-xsrf', 'foo')