From c95721a40b25ab583e6f180ce5f857a6532e56e6 Mon Sep 17 00:00:00 2001 From: Davis McPhee Date: Fri, 6 Oct 2023 15:32:29 -0300 Subject: [PATCH] [Data Discovery] Unskip and fix Serverless API integration tests (#168116) ## Summary This PR unskips and fixes previously flaky Serverless API integration tests. Flaky test runs: - x100: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3364 Resolves #165868. Resolves #165944. Resolves #165972. Resolves #165942. Resolves #165476. Resolves #165511. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### 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) --- .../default_index_pattern/default_index_pattern.ts | 5 ++++- .../test_suites/common/data_views/es_errors/errors.js | 3 +-- .../data_views/fields_for_wildcard_route/conflicts.ts | 3 +-- .../common/data_views/fields_for_wildcard_route/params.ts | 3 +-- .../test_suites/common/management/rollups.ts | 3 +-- .../test_suites/common/management/scripted_fields.ts | 7 +++++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/x-pack/test_serverless/api_integration/test_suites/common/data_views/default_index_pattern/default_index_pattern.ts b/x-pack/test_serverless/api_integration/test_suites/common/data_views/default_index_pattern/default_index_pattern.ts index bdd688f1718aa..0ac0bec2250ed 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/data_views/default_index_pattern/default_index_pattern.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/data_views/default_index_pattern/default_index_pattern.ts @@ -69,7 +69,10 @@ export default function ({ getService }: FtrProviderContext) { .get(defaultPath) // TODO: API requests in Serverless require internal request headers .set(svlCommonApi.getInternalRequestHeader()); - expect(response6.body[serviceKeyId]).to.be(null); + // TODO: The response comes back undefined in Serverless + const body = response6.body[serviceKeyId]; + const expected = body === undefined ? null : body; + expect(expected).to.be(null); }); }); }); diff --git a/x-pack/test_serverless/api_integration/test_suites/common/data_views/es_errors/errors.js b/x-pack/test_serverless/api_integration/test_suites/common/data_views/es_errors/errors.js index f8556727d9c17..ddbc88cce8045 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/data_views/es_errors/errors.js +++ b/x-pack/test_serverless/api_integration/test_suites/common/data_views/es_errors/errors.js @@ -22,8 +22,7 @@ export default function ({ getService }) { const es = getService('es'); const esArchiver = getService('esArchiver'); - // FLAKY: https://github.com/elastic/kibana/issues/165944 - describe.skip('index_patterns/* error handler', () => { + describe('index_patterns/* error handler', () => { let indexNotFoundError; let docNotFoundError; before(async () => { diff --git a/x-pack/test_serverless/api_integration/test_suites/common/data_views/fields_for_wildcard_route/conflicts.ts b/x-pack/test_serverless/api_integration/test_suites/common/data_views/fields_for_wildcard_route/conflicts.ts index a358bb8a3d469..d1d08c1e88832 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/data_views/fields_for_wildcard_route/conflicts.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/data_views/fields_for_wildcard_route/conflicts.ts @@ -16,8 +16,7 @@ export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const svlCommonApi = getService('svlCommonApi'); - // FLAKY: https://github.com/elastic/kibana/issues/165972 - describe.skip('conflicts', () => { + describe('conflicts', () => { before(() => esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/conflicts') ); diff --git a/x-pack/test_serverless/api_integration/test_suites/common/data_views/fields_for_wildcard_route/params.ts b/x-pack/test_serverless/api_integration/test_suites/common/data_views/fields_for_wildcard_route/params.ts index 66aa266810530..035ca1af4b5a8 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/data_views/fields_for_wildcard_route/params.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/data_views/fields_for_wildcard_route/params.ts @@ -16,8 +16,7 @@ export default function ({ getService }: FtrProviderContext) { const randomness = getService('randomness'); const svlCommonApi = getService('svlCommonApi'); - // FLAKY https://github.com/elastic/kibana/issues/165942 - describe.skip('params', () => { + describe('params', () => { before(() => esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index') ); diff --git a/x-pack/test_serverless/api_integration/test_suites/common/management/rollups.ts b/x-pack/test_serverless/api_integration/test_suites/common/management/rollups.ts index 62baa03c10aad..4492539224f9b 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/management/rollups.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/management/rollups.ts @@ -16,8 +16,7 @@ export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); - // Failing: See https://github.com/elastic/kibana/issues/165476 - describe.skip('rollup data views - fields for wildcard', function () { + describe('rollup data views - fields for wildcard', function () { before(async () => { await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); }); diff --git a/x-pack/test_serverless/api_integration/test_suites/common/management/scripted_fields.ts b/x-pack/test_serverless/api_integration/test_suites/common/management/scripted_fields.ts index bfe1078df11be..0f17561ea7edc 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/management/scripted_fields.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/management/scripted_fields.ts @@ -12,10 +12,13 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); - // FLAKY: https://github.com/elastic/kibana/issues/165511 - describe.skip('scripted fields disabled', function () { + describe('scripted fields disabled', function () { before(async () => { + // TODO: We're running into a 'Duplicate data view: basic_index' + // error in Serverless, so make sure to clean up first + await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index'); });