-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rollups] Fix functional tests (#186103)
Fixes #183975 Fixes #183976 Fixes #183925 Fixes #183926 Fixes #183927 Fixes #104569 Fixes #56816 Fixes #168267 ## Summary This PR fixes the failing Rollup functional tests. The reason for the failures is that, since 8.15, Es doesn't allow creating a new rollup job if there is no existing rollup usage in the cluster, where rollup usage is considered rollup jobs or rollup indices. To fix the tests, we create a mock rollup index which essentially is an index that has a `_meta` mappings property with rollup information. Flaky test runner build x200: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6316
- Loading branch information
1 parent
350b34b
commit b44e778
Showing
4 changed files
with
71 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import Client from '@elastic/elasticsearch/lib/client'; | ||
|
||
export const MOCK_ROLLUP_INDEX_NAME = 'mock-rollup-index'; | ||
|
||
export const createMockRollupIndex = async (es: Client) => { | ||
await es.indices.create({ | ||
index: MOCK_ROLLUP_INDEX_NAME, | ||
mappings: { | ||
_meta: { | ||
_rollup: { | ||
logs_job: { | ||
id: 'mockRollupJob', | ||
index_pattern: MOCK_ROLLUP_INDEX_NAME, | ||
rollup_index: 'rollup_index', | ||
cron: '0 0 0 ? * 7', | ||
page_size: 1000, | ||
groups: { | ||
date_histogram: { | ||
interval: '24h', | ||
delay: '1d', | ||
time_zone: 'UTC', | ||
field: 'testCreatedField', | ||
}, | ||
terms: { | ||
fields: ['testTotalField', 'testTagField'], | ||
}, | ||
histogram: { | ||
interval: '7', | ||
fields: ['testTotalField'], | ||
}, | ||
}, | ||
}, | ||
}, | ||
'rollup-version': '', | ||
}, | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters