mirror of
https://github.com/elastic/eland.git
synced 2025-07-11 00:02:14 +08:00
Adds function to increase script.max_compilations_rate to prevent test failures
This commit is contained in:
parent
9e176f08f3
commit
08357126cb
@ -1,5 +1,6 @@
|
|||||||
from elasticsearch import Elasticsearch
|
from elasticsearch import Elasticsearch
|
||||||
from elasticsearch import helpers
|
from elasticsearch import helpers
|
||||||
|
from elasticsearch.client import ClusterClient
|
||||||
|
|
||||||
from eland.tests import *
|
from eland.tests import *
|
||||||
|
|
||||||
@ -50,6 +51,16 @@ def _setup_data(es):
|
|||||||
|
|
||||||
print("Done", index_name)
|
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):
|
def _setup_test_mappings(es):
|
||||||
# Create a complex mapping containing many Elasticsearch features
|
# Create a complex mapping containing many Elasticsearch features
|
||||||
@ -72,3 +83,4 @@ if __name__ == '__main__':
|
|||||||
_setup_data(es)
|
_setup_data(es)
|
||||||
_setup_test_mappings(es)
|
_setup_test_mappings(es)
|
||||||
_setup_test_nested(es)
|
_setup_test_nested(es)
|
||||||
|
_update_max_compilations_limit(es)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user