From 28beb60d79de4a20654a2b9104151bcf03f43c47 Mon Sep 17 00:00:00 2001 From: spalger Date: Wed, 13 Jan 2021 17:58:19 -0700 Subject: [PATCH] [kbn/es] start es with raised indices.query.bool.max_nested_depth (cherry picked from commit e914a60ba8c335a187e8a269596e5072ed4502ee) --- packages/kbn-es/src/cluster.js | 3 +- .../src/integration_tests/cluster.test.js | 39 ++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/packages/kbn-es/src/cluster.js b/packages/kbn-es/src/cluster.js index eaf353b3e55d..176c4304055a 100644 --- a/packages/kbn-es/src/cluster.js +++ b/packages/kbn-es/src/cluster.js @@ -257,8 +257,9 @@ exports.Cluster = class Cluster { this._log.info(chalk.bold('Starting')); this._log.indent(4); + const esArgs = ['indices.query.bool.max_nested_depth=100'].concat(options.esArgs || []); + // Add to esArgs if ssl is enabled - const esArgs = [].concat(options.esArgs || []); if (this._ssl) { esArgs.push('xpack.security.http.ssl.enabled=true'); esArgs.push(`xpack.security.http.ssl.keystore.path=${ES_P12_PATH}`); diff --git a/packages/kbn-es/src/integration_tests/cluster.test.js b/packages/kbn-es/src/integration_tests/cluster.test.js index 6229a8add0d2..33bce2932fe2 100644 --- a/packages/kbn-es/src/integration_tests/cluster.test.js +++ b/packages/kbn-es/src/integration_tests/cluster.test.js @@ -17,12 +17,19 @@ * under the License. */ -const { ToolingLog, ES_P12_PATH, ES_P12_PASSWORD } = require('@kbn/dev-utils'); +const { + ToolingLog, + ES_P12_PATH, + ES_P12_PASSWORD, + createAnyInstanceSerializer, +} = require('@kbn/dev-utils'); const execa = require('execa'); const { Cluster } = require('../cluster'); const { installSource, installSnapshot, installArchive } = require('../install'); const { extractConfigFiles } = require('../utils/extract_config_files'); +expect.addSnapshotSerializer(createAnyInstanceSerializer(ToolingLog)); + jest.mock('../install', () => ({ installSource: jest.fn(), installSnapshot: jest.fn(), @@ -265,8 +272,19 @@ describe('#start(installPath)', () => { const cluster = new Cluster({ log, ssl: false }); await cluster.start(); - const config = extractConfigFiles.mock.calls[0][0]; - expect(config).toHaveLength(0); + expect(extractConfigFiles.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + Array [ + "indices.query.bool.max_nested_depth=100", + ], + undefined, + Object { + "log": , + }, + ], + ] + `); }); }); @@ -332,8 +350,19 @@ describe('#run()', () => { const cluster = new Cluster({ log, ssl: false }); await cluster.run(); - const config = extractConfigFiles.mock.calls[0][0]; - expect(config).toHaveLength(0); + expect(extractConfigFiles.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + Array [ + "indices.query.bool.max_nested_depth=100", + ], + undefined, + Object { + "log": , + }, + ], + ] + `); }); });