[Security Solution] [Endpoint] Cypress Increase create policy task timeout (#170001)

## Summary

Increase policy task timeout to 5 minutes to avoid flaky tests.

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
David Sánchez 2023-11-09 11:48:20 +01:00 committed by GitHub
parent 5c44377de1
commit b86e74106d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 11 deletions

View file

@ -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();
});

View file

@ -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'],
@ -24,7 +23,11 @@ describe.skip(
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;
});
});

View file

@ -81,15 +81,20 @@ export const yieldEndpointPolicyRevision = (): Cypress.Chainable<number> =>
export const createAgentPolicyTask = (
version: string,
policyPrefix?: string
policyPrefix?: string,
timeout?: number
): Cypress.Chainable<IndexedFleetEndpointPolicyResponse> => {
const policyName = `${policyPrefix || 'Reassign'} ${Math.random().toString(36).substring(2, 7)}`;
return cy.task<IndexedFleetEndpointPolicyResponse>('indexFleetEndpointPolicy', {
policyName,
endpointPackageVersion: version,
agentPolicyName: policyName,
});
return cy.task<IndexedFleetEndpointPolicyResponse>(
'indexFleetEndpointPolicy',
{
policyName,
endpointPackageVersion: version,
agentPolicyName: policyName,
},
{ timeout: timeout ?? 5 * 60 * 1000 }
);
};
export const enableAgentTamperProtectionFeatureFlagInPolicy = (agentPolicyId: string) => {