From 08357126cb6712f68897f185eebd552f49e9030c Mon Sep 17 00:00:00 2001 From: Winterflower Date: Mon, 2 Dec 2019 13:08:47 +0100 Subject: [PATCH] Adds function to increase script.max_compilations_rate to prevent test failures --- eland/tests/setup_tests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/eland/tests/setup_tests.py b/eland/tests/setup_tests.py index b507acc..43f78b0 100644 --- a/eland/tests/setup_tests.py +++ b/eland/tests/setup_tests.py @@ -1,5 +1,6 @@ from elasticsearch import Elasticsearch from elasticsearch import helpers +from elasticsearch.client import ClusterClient from eland.tests import * @@ -50,6 +51,16 @@ def _setup_data(es): print("Done", index_name) +def _update_max_compilations_limit(es, limit="10000/1m"): + print('Updating script.max_compilations_rate to ', limit) + cluster_client = ClusterClient(es) + body = { + "transient" : { + "script.max_compilations_rate" : limit + } + } + cluster_client.put_settings(body=body) + def _setup_test_mappings(es): # Create a complex mapping containing many Elasticsearch features @@ -72,3 +83,4 @@ if __name__ == '__main__': _setup_data(es) _setup_test_mappings(es) _setup_test_nested(es) + _update_max_compilations_limit(es)