Skip to content

Commit 4a4624b

Browse files
[Backport 8.8] Fix integration test runner for 8.8 (#1862)
Co-authored-by: Josh Mock <josh@joshmock.com>
1 parent 28f5683 commit 4a4624b

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

test/integration/test-runner.js

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ function build (opts = {}) {
8585
)
8686

8787
// remove 'x_pack_rest_user', used in some xpack test
88-
await client.security.deleteUser({ username: 'x_pack_rest_user' }, { ignore: [404] })
88+
try {
89+
await client.security.deleteUser({ username: 'x_pack_rest_user' }, { ignore: [404] })
90+
} catch {
91+
// do nothing
92+
}
8993

9094
const searchableSnapshotIndices = await client.cluster.state({
9195
metric: 'metadata',
@@ -137,7 +141,11 @@ function build (opts = {}) {
137141
const body = await client.cluster.getComponentTemplate()
138142
const components = body.component_templates.filter(c => !isXPackTemplate(c.name)).map(c => c.name)
139143
if (components.length > 0) {
140-
await client.cluster.deleteComponentTemplate({ name: components.join(',') }, { ignore: [404] })
144+
try {
145+
await client.cluster.deleteComponentTemplate({ name: components.join(',') }, { ignore: [404] })
146+
} catch {
147+
// do nothing
148+
}
141149
}
142150

143151
// Remove any cluster setting
@@ -157,9 +165,25 @@ function build (opts = {}) {
157165
if (isXPack) {
158166
// delete ilm policies
159167
const preserveIlmPolicies = [
160-
'ilm-history-ilm-policy', 'slm-history-ilm-policy',
161-
'watch-history-ilm-policy', 'ml-size-based-ilm-policy',
162-
'logs', 'metrics'
168+
"ilm-history-ilm-policy",
169+
"slm-history-ilm-policy",
170+
"watch-history-ilm-policy",
171+
"watch-history-ilm-policy-16",
172+
"ml-size-based-ilm-policy",
173+
"logs",
174+
"metrics",
175+
"synthetics",
176+
"7-days-default",
177+
"30-days-default",
178+
"90-days-default",
179+
"180-days-default",
180+
"365-days-default",
181+
".fleet-actions-results-ilm-policy",
182+
".fleet-file-data-ilm-policy",
183+
".fleet-files-ilm-policy",
184+
".deprecation-indexing-ilm-policy",
185+
".monitoring-8-ilm-policy",
186+
"behavioral_analytics-events-default_policy",
163187
]
164188
const policies = await client.ilm.getLifecycle()
165189
for (const policy in policies) {
@@ -257,7 +281,7 @@ function build (opts = {}) {
257281
* - cleanup
258282
* @param {object} setup (null if not needed)
259283
* @param {object} test
260-
* @oaram {object} teardown (null if not needed)
284+
* @param {object} teardown (null if not needed)
261285
* @returns {Promise}
262286
*/
263287
async function run (setup, test, teardown, stats, junit) {

0 commit comments

Comments
 (0)