[kbn/es] start es with raised indices.query.bool.max_nested_depth

(cherry picked from commit e914a60ba8c335a187e8a269596e5072ed4502ee)
This commit is contained in:
spalger 2021-01-13 17:58:19 -07:00
parent 03bc632204
commit 28beb60d79
2 changed files with 36 additions and 6 deletions

View file

@ -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}`);

View file

@ -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": <ToolingLog>,
},
],
]
`);
});
});
@ -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": <ToolingLog>,
},
],
]
`);
});
});