Skip to content

Commit

Permalink
[8.15] [Fleet] Fix failing/flaky tests (elastic#189559) (elastic#189667)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.15`:
- [[Fleet] Fix failing/flaky tests
(elastic#189559)](elastic#189559)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kyle
Pollich","email":"kyle.pollich@elastic.co"},"sourceCommit":{"committedDate":"2024-07-31T18:14:30Z","message":"[Fleet]
Fix failing/flaky tests (elastic#189559)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184310\r\nCloses
https://github.com/elastic/kibana/issues/180071\r\nCloses
https://github.com/elastic/kibana/issues/109017\r\n\r\nFixes several
flaky/failing tests that were qualified as
8.15.0\r\nblockers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"4b701de03636bffe0e73a7d66ac589f27cb8530f","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.15.0","v8.16.0"],"title":"[Fleet]
Fix failing/flaky tests
","number":189559,"url":"https://github.com/elastic/kibana/pull/189559","mergeCommit":{"message":"[Fleet]
Fix failing/flaky tests (elastic#189559)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184310\r\nCloses
https://github.com/elastic/kibana/issues/180071\r\nCloses
https://github.com/elastic/kibana/issues/109017\r\n\r\nFixes several
flaky/failing tests that were qualified as
8.15.0\r\nblockers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"4b701de03636bffe0e73a7d66ac589f27cb8530f"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/189559","number":189559,"mergeCommit":{"message":"[Fleet]
Fix failing/flaky tests (elastic#189559)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184310\r\nCloses
https://github.com/elastic/kibana/issues/180071\r\nCloses
https://github.com/elastic/kibana/issues/109017\r\n\r\nFixes several
flaky/failing tests that were qualified as
8.15.0\r\nblockers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"4b701de03636bffe0e73a7d66ac589f27cb8530f"}}]}]
BACKPORT-->

Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
  • Loading branch information
kibanamachine and kpollich authored Jul 31, 2024
1 parent 1ac9f28 commit 6c28d96
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 82 deletions.
13 changes: 4 additions & 9 deletions x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export default function (providerContext: FtrProviderContext) {
.expect(201);
}

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/180071
describe.skip('fleet_final_pipeline', () => {
describe('fleet_final_pipeline', () => {
skipIfNoDockerRegistry(providerContext);
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server');
Expand Down Expand Up @@ -157,9 +156,7 @@ export default function (providerContext: FtrProviderContext) {
body: {
message: 'message-test-1',
event: {
original: {
foo: 'bar',
},
original: JSON.stringify({ foo: 'bar' }),
},
'@timestamp': '2023-01-01T09:00:00',
tags: [],
Expand All @@ -185,9 +182,7 @@ export default function (providerContext: FtrProviderContext) {
body: {
message: 'message-test-1',
event: {
original: {
foo: 'bar',
},
original: JSON.stringify({ foo: 'bar' }),
},
'@timestamp': '2023-01-01T09:00:00',
tags: ['preserve_original_event'],
Expand All @@ -204,7 +199,7 @@ export default function (providerContext: FtrProviderContext) {

const event = doc._source.event;

expect(event.original).to.eql({ foo: 'bar' });
expect(event.original).to.eql(JSON.stringify({ foo: 'bar' }));
});

const scenarios = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,83 +19,14 @@ export default function (providerContext: FtrProviderContext) {
await supertest.delete(`/api/fleet/epm/packages/${name}/${version}`).set('kbn-xsrf', 'xxxx');
};

// Failing: See https://github.com/elastic/kibana/issues/184310
describe.skip('installing with hidden datastream', async () => {
describe('installing with hidden datastream', async () => {
skipIfNoDockerRegistry(providerContext);
setupFleetAndAgents(providerContext);

afterEach(async () => {
await deletePackage('apm', '8.8.0');
});

it('should rollover hidden datastreams when failed to update mappings', async function () {
await supertest
.post(`/api/fleet/epm/packages/apm/8.7.0`)
.set('kbn-xsrf', 'xxxx')
.send({ force: true })
.expect(200);

const writeDoc = () =>
es.index({
refresh: true,
index: 'metrics-apm.service_summary.10m-default',
document: {
'@timestamp': '2023-05-30T07:50:00.000Z',
agent: {
name: 'go',
},
data_stream: {
dataset: 'apm.service_summary.10m',
namespace: 'default',
type: 'metrics',
},
ecs: {
version: '8.6.0-dev',
},
event: {
agent_id_status: 'missing',
ingested: '2023-05-30T07:57:12Z',
},
metricset: {
interval: '10m',
name: 'service_summary',
},
observer: {
hostname: '047e282994fb',
type: 'apm-server',
version: '8.7.0',
},
processor: {
event: 'metric',
name: 'metric',
},
service: {
language: {
name: 'go',
},
name: '___main_elastic_cloud_87_ilm_fix',
},
},
});

await writeDoc();

await supertest
.post(`/api/fleet/epm/packages/apm/8.8.0`)
.set('kbn-xsrf', 'xxxx')
.send({ force: true })
.expect(200);

// Rollover are lazy need to write a new doc
await writeDoc();
const ds = await es.indices.get({
index: 'metrics-apm.service_summary*',
expand_wildcards: ['open', 'hidden'],
});
// datastream rolled over
expect(Object.keys(ds).length).greaterThan(1);
});

it('should not rollover datastreams when successfully updated mappings', async function () {
await supertest
.post(`/api/fleet/epm/packages/apm/8.8.0`)
Expand Down
7 changes: 4 additions & 3 deletions x-pack/test/fleet_functional/apps/home/welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['common', 'home']);
const PageObjects = getPageObjects(['common', 'home', 'header']);
const kibanaServer = getService('kibanaServer');

// FLAKY: https://github.com/elastic/kibana/issues/109017
describe.skip('Welcome interstitial', () => {
describe('Welcome interstitial', () => {
before(async () => {
// Need to navigate to page first to clear storage before test can be run
await PageObjects.common.navigateToUrl('home', undefined);
Expand All @@ -33,6 +32,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

// Reload the home screen and verify the interstitial is displayed
await PageObjects.common.navigateToUrl('home', undefined, { disableWelcomePrompt: false });
await PageObjects.header.waitUntilLoadingHasFinished();

expect(await PageObjects.home.isWelcomeInterstitialDisplayed()).to.be(true);
});

Expand Down

0 comments on commit 6c28d96

Please sign in to comment.