From 1e231f836dae44716dfc3595ace7f30ae5de7c4e Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 9 Jul 2024 22:56:09 +0200 Subject: [PATCH] [8.15] [Cloud Security] fix vulnerability dashboard ftr flaky test (#187790) (#187912) # Backport This will backport the following commits from `main` to `8.15`: - [[Cloud Security] fix vulnerability dashboard ftr flaky test (#187790)](https://github.com/elastic/kibana/pull/187790) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Lola --- .../routes/vulnerabilities_dashboard.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts b/x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts index aa2887a04da21..8f2a2fa2693d4 100644 --- a/x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts +++ b/x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts @@ -186,16 +186,13 @@ export default function ({ getService }: FtrProviderContext) { describe('Vulnerability Dashboard API', async () => { beforeEach(async () => { + await index.removeFindings(); + await index.removeScores(); await waitForPluginInitialized(); await index.addScores(scoresVulnerabilitiesMock); await index.addFindings(vulnerabilitiesLatestMock); }); - afterEach(async () => { - await index.removeFindings(); - await index.removeScores(); - }); - it('responds with a 200 status code and matching data mock', async () => { const { body } = await supertest .get(`/internal/cloud_security_posture/vulnerabilities_dashboard`)