[Security Solution] Reenable rules table filtering serverless tests (#166771)

**Relates to:** https://github.com/elastic/kibana/issues/161540

## Summary

This PR unskips rules table filtering serverless tests.

Serverless [rules_table_filtering.cy.ts (100
runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3205)
🟢
This commit is contained in:
Maxim Palenov 2023-09-28 07:19:13 -07:00 committed by GitHub
parent e6e3e2d188
commit 88b8b8c190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 13 deletions

View file

@ -29,9 +29,7 @@ import {
import { disableAutoRefresh } from '../../../../tasks/alerts_detection_rules';
import { getNewRule } from '../../../../objects/rule';
// TODO: https://github.com/elastic/kibana/issues/161540
// Flaky in serverless tests
describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => {
describe('Rules table: filtering', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
});
@ -44,11 +42,8 @@ describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@skipInServe
cy.task('esArchiverResetKibana');
});
// TODO: https://github.com/elastic/kibana/issues/161540
describe.skip('Last response filter', () => {
// Flaky in serverless tests
// @brokenInServerless tag is not working so a skip was needed
it('Filters rules by last response', { tags: ['@brokenInServerless'] }, function () {
describe('Last response filter', () => {
it('Filters rules by last response', function () {
deleteIndex('test_index');
createIndex('test_index', {

View file

@ -9,8 +9,12 @@ import { rootRequest } from '../common';
export const deleteIndex = (index: string) => {
rootRequest({
method: 'DELETE',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}?refresh=wait_for`,
headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' },
url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}`,
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
failOnStatusCode: false,
});
};
@ -19,7 +23,11 @@ export const deleteDataStream = (dataStreamName: string) => {
rootRequest({
method: 'DELETE',
url: `${Cypress.env('ELASTICSEARCH_URL')}/_data_stream/${dataStreamName}`,
headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' },
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
failOnStatusCode: false,
});
};
@ -30,6 +38,11 @@ export const deleteAllDocuments = (target: string) =>
url: `${Cypress.env(
'ELASTICSEARCH_URL'
)}/${target}/_delete_by_query?conflicts=proceed&scroll_size=10000&refresh`,
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
body: {
query: {
match_all: {},
@ -41,6 +54,11 @@ export const createIndex = (indexName: string, properties: Record<string, unknow
rootRequest({
method: 'PUT',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${indexName}`,
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
body: {
mappings: {
properties,
@ -52,6 +70,11 @@ export const createDocument = (indexName: string, document: Record<string, unkno
rootRequest({
method: 'POST',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${indexName}/_doc?refresh=wait_for`,
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
body: document,
});
@ -61,7 +84,11 @@ export const waitForNewDocumentToBeIndexed = (index: string, initialNumberOfDocu
rootRequest<{ hits: { hits: unknown[] } }>({
method: 'GET',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}/_search`,
headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' },
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
failOnStatusCode: false,
}).then((response) => {
if (response.status !== 200) {
@ -80,7 +107,11 @@ export const refreshIndex = (index: string) => {
rootRequest({
method: 'POST',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}/_refresh`,
headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' },
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
failOnStatusCode: false,
}).then((response) => {
if (response.status !== 200) {