From a59e1167ee04a11119a26bed8c98968b90a09235 Mon Sep 17 00:00:00 2001 From: David Sanchez Soler Date: Fri, 27 Oct 2023 10:04:46 +0200 Subject: [PATCH 1/5] Increase create policy task timeout --- .../public/management/cypress/tasks/fleet.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts b/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts index 8f1da4a0ec020..bc0f94d712058 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts @@ -81,15 +81,20 @@ export const yieldEndpointPolicyRevision = (): Cypress.Chainable => export const createAgentPolicyTask = ( version: string, - policyPrefix?: string + policyPrefix?: string, + timeout?: number ): Cypress.Chainable => { const policyName = `${policyPrefix || 'Reassign'} ${Math.random().toString(36).substring(2, 7)}`; - return cy.task('indexFleetEndpointPolicy', { - policyName, - endpointPackageVersion: version, - agentPolicyName: policyName, - }); + return cy.task( + 'indexFleetEndpointPolicy', + { + policyName, + endpointPackageVersion: version, + agentPolicyName: policyName, + }, + { timeout: timeout ?? 5 * 60 * 1000 } + ); }; export const enableAgentTamperProtectionFeatureFlagInPolicy = (agentPolicyId: string) => { From fd84354a8e83eaec086d24aac509ab938f1b7153 Mon Sep 17 00:00:00 2001 From: David Sanchez Soler Date: Tue, 7 Nov 2023 12:14:33 +0100 Subject: [PATCH 2/5] Unskip tests --- .../e2e/response_actions/response_console/execute.cy.ts | 3 +-- .../serverless/policy_details_with_security_essentials.cy.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts index d43037f4d7f97..dad573bb09c2b 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts @@ -21,8 +21,7 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -// FLAKY: https://github.com/elastic/kibana/issues/170373 -describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => { +describe('Response console', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts index efb48f6543542..1cb0c382ca707 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts @@ -9,8 +9,7 @@ import { login } from '../../tasks/login'; import { visitPolicyDetailsPage } from '../../screens/policy_details'; import type { IndexedFleetEndpointPolicyResponse } from '../../../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; -// FLAKY: https://github.com/elastic/kibana/issues/170666 -describe.skip( +describe( 'When displaying the Policy Details in Security Essentials PLI', { tags: ['@serverless'], From 8003b3bd5423e103e9efe2e92578a7fc5f21cf59 Mon Sep 17 00:00:00 2001 From: David Sanchez Soler Date: Wed, 8 Nov 2023 11:51:03 +0100 Subject: [PATCH 3/5] Increase timeout --- x-pack/plugins/security_solution/package.json | 2 +- .../serverless/policy_details_with_security_essentials.cy.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/package.json b/x-pack/plugins/security_solution/package.json index a13046b0bc59f..b32b8c21ab956 100644 --- a/x-pack/plugins/security_solution/package.json +++ b/x-pack/plugins/security_solution/package.json @@ -15,7 +15,7 @@ "cypress:dw:run": "yarn cypress:dw run", "cypress:dw:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file ./public/management/cypress/cypress_serverless.config.ts --ftr-config-file ../../test/defend_workflows_cypress/serverless_config", "cypress:dw:serverless:open": "yarn cypress:dw:serverless open", - "cypress:dw:serverless:run": "yarn cypress:dw:serverless run", + "cypress:dw:serverless:run": "yarn cypress:dw:serverless run --spec ./public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts", "cypress:dw:serverless:changed-specs-only": "yarn cypress:dw:serverless run --changed-specs-only --env burn=2", "cypress:dw:endpoint": "echo '\n** WARNING **: Run script `cypress:dw:endpoint` no longer valid! Use `cypress:dw` instead\n'", "cypress:dw:endpoint:run": "echo '\n** WARNING **: Run script `cypress:dw:endpoint:run` no longer valid! Use `cypress:dw:run` instead\n'", diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts index 1cb0c382ca707..2f969fc7d2c4d 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts @@ -40,7 +40,7 @@ describe( }); it('should display upselling section for protections', () => { - cy.getByTestSubj('endpointPolicy-protectionsLockedCard', { timeout: 60000 }) + cy.getByTestSubj('endpointPolicy-protectionsLockedCard', { timeout: 5 * 60 * 1000 }) .should('exist') .and('be.visible'); }); From a9fdf46fbec34afe8bf057b5bb58402261496ec5 Mon Sep 17 00:00:00 2001 From: David Sanchez Soler Date: Wed, 8 Nov 2023 13:03:43 +0100 Subject: [PATCH 4/5] Increase timeout task instead of element --- .../policy_details_with_security_essentials.cy.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts index 2f969fc7d2c4d..36ebb060454c5 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts @@ -23,7 +23,11 @@ describe( let loadedPolicyData: IndexedFleetEndpointPolicyResponse; before(() => { - cy.task('indexFleetEndpointPolicy', { policyName: 'tests-serverless' }).then((response) => { + cy.task( + 'indexFleetEndpointPolicy', + { policyName: 'tests-serverless' }, + { timeout: 5 * 60 * 1000 } + ).then((response) => { loadedPolicyData = response as IndexedFleetEndpointPolicyResponse; }); }); @@ -40,7 +44,7 @@ describe( }); it('should display upselling section for protections', () => { - cy.getByTestSubj('endpointPolicy-protectionsLockedCard', { timeout: 5 * 60 * 1000 }) + cy.getByTestSubj('endpointPolicy-protectionsLockedCard', { timeout: 60000 }) .should('exist') .and('be.visible'); }); From 9309388f983995a7052c634b9b5026f7bf407821 Mon Sep 17 00:00:00 2001 From: David Sanchez Soler Date: Wed, 8 Nov 2023 15:08:03 +0100 Subject: [PATCH 5/5] Revert package.json changes --- x-pack/plugins/security_solution/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/package.json b/x-pack/plugins/security_solution/package.json index b32b8c21ab956..a13046b0bc59f 100644 --- a/x-pack/plugins/security_solution/package.json +++ b/x-pack/plugins/security_solution/package.json @@ -15,7 +15,7 @@ "cypress:dw:run": "yarn cypress:dw run", "cypress:dw:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file ./public/management/cypress/cypress_serverless.config.ts --ftr-config-file ../../test/defend_workflows_cypress/serverless_config", "cypress:dw:serverless:open": "yarn cypress:dw:serverless open", - "cypress:dw:serverless:run": "yarn cypress:dw:serverless run --spec ./public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts", + "cypress:dw:serverless:run": "yarn cypress:dw:serverless run", "cypress:dw:serverless:changed-specs-only": "yarn cypress:dw:serverless run --changed-specs-only --env burn=2", "cypress:dw:endpoint": "echo '\n** WARNING **: Run script `cypress:dw:endpoint` no longer valid! Use `cypress:dw` instead\n'", "cypress:dw:endpoint:run": "echo '\n** WARNING **: Run script `cypress:dw:endpoint:run` no longer valid! Use `cypress:dw:run` instead\n'",