Wait for backfill SOs to be deleted before running the invalidate API key task (#198422)

Resolves https://github.com/elastic/kibana/issues/198168

Flaky test runners:
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7309
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7314
This commit is contained in:
Mike Côté 2024-10-31 14:38:48 -04:00 committed by GitHub
parent d1531e351e
commit 7b05079d94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -252,6 +252,17 @@ export default function apiKeyBackfillTests({ getService }: FtrProviderContext)
expect(e?.event?.outcome).to.eql('success');
}
// wait for all the ad hoc run SO to be deleted
await retry.try(async () => {
try {
// throws when not found
await getAdHocRunSO(backfillId);
throw new Error('should have thrown');
} catch (e) {
expect(e.message).not.to.eql('should have thrown');
}
});
// invoke the invalidate task
await runInvalidateTask();