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)