Adds function to increase script.max_compilations_rate to prevent test failures

This commit is contained in:
Winterflower 2019-12-02 13:08:47 +01:00
parent 9e176f08f3
commit 08357126cb

View File

@ -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)