Skip to content

Commit

Permalink
[Security Solution] [Endpoint] Cypress Increase create policy task ti…
Browse files Browse the repository at this point in the history
…meout (elastic#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>
  • Loading branch information
dasansol92 and kibanamachine authored Nov 9, 2023
1 parent 5c44377 commit b86e741
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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;
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit b86e741

Please sign in to comment.