Longer timeout for the test client to fix travis CI
This commit is contained in:
@@ -9,13 +9,14 @@ except ImportError:
|
|||||||
from elasticsearch import Elasticsearch
|
from elasticsearch import Elasticsearch
|
||||||
from elasticsearch.exceptions import ConnectionError
|
from elasticsearch.exceptions import ConnectionError
|
||||||
|
|
||||||
def get_test_client(nowait=False):
|
def get_test_client(nowait=False, **kwargs):
|
||||||
# construct kwargs from the environment
|
# construct kwargs from the environment
|
||||||
kw = {}
|
kw = {'timeout': 30}
|
||||||
if 'TEST_ES_CONNECTION' in os.environ:
|
if 'TEST_ES_CONNECTION' in os.environ:
|
||||||
from elasticsearch import connection
|
from elasticsearch import connection
|
||||||
kw['connection_class'] = getattr(connection, os.environ['TEST_ES_CONNECTION'])
|
kw['connection_class'] = getattr(connection, os.environ['TEST_ES_CONNECTION'])
|
||||||
|
|
||||||
|
kw.update(kwargs)
|
||||||
client = Elasticsearch([os.environ.get('TEST_ES_SERVER', {})], **kw)
|
client = Elasticsearch([os.environ.get('TEST_ES_SERVER', {})], **kw)
|
||||||
|
|
||||||
# wait for yellow status
|
# wait for yellow status
|
||||||
|
|||||||
Reference in New Issue
Block a user