Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration testing: increase timeouts for ES starting #109

Merged
merged 1 commit into from Feb 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions build.bat
Expand Up @@ -12,6 +12,15 @@ set DRIVER_BASE_NAME=esodbc
set ARG="%*"
set SRC_PATH=%~dp0

REM presence of 'help'/'?': invoke USAGE "function" and exit
if /i not [%ARG:help=%] == [%ARG%] (
call:USAGE %0
goto END
) else if not [%ARG:?=%] == [%ARG%] (
call:USAGE %0
goto END
)

call:SET_ARCH
call:SET_CMAKE
call:SET_PYTHON
Expand All @@ -22,15 +31,6 @@ REM
REM Perform the building steps
REM

REM presence of 'help'/'?': invoke USAGE "function" and exit
if /i not [%ARG:help=%] == [%ARG%] (
call:USAGE %0
goto END
) else if not [%ARG:?=%] == [%ARG%] (
call:USAGE %0
goto END
)

if /i not [%ARG:ctests=%] == [%ARG%] (
call:CTESTS
goto END
Expand Down
5 changes: 3 additions & 2 deletions test/integration/elasticsearch.py
Expand Up @@ -32,7 +32,8 @@ class Elasticsearch(object):
TERM_TIMEOUT = 5 # how long to wait for processes to die (before KILLing)
REQ_TIMEOUT = 20 # default GET request timeout
ES_PORT = 9200
ES_START_TIMEOUT = 30
ES_START_TIMEOUT = 60 # how long to wait for Elasticsearch to come online
ES_401_RETRIES = 8 # how many "starting" 401 answers to accept before giving up (.5s waiting inbetween)
AUTH_PASSWORD = "elastic"

def __init__(self):
Expand Down Expand Up @@ -142,7 +143,7 @@ def _start_elasticsearch(self, es_dir):
failures += 1
# it seems that on a "fortunate" timing, ES will return a 401 when just starting, even if no
# authentication is enabled at this point: try to give it more time to start
if 3 < failures:
if self.ES_401_RETRIES < failures:
raise e
time.sleep(.5)
if self.ES_START_TIMEOUT < time.time() - waiting_since:
Expand Down
2 changes: 1 addition & 1 deletion test/integration/testing.py
Expand Up @@ -11,7 +11,7 @@
from elasticsearch import Elasticsearch
from data import TestData

CONNECT_STRING = 'Driver={Elasticsearch Driver};UID=elastic;PWD=%s;Secure=0' % Elasticsearch.AUTH_PASSWORD
CONNECT_STRING = 'Driver={Elasticsearch Driver};UID=elastic;PWD=%s;Secure=0;' % Elasticsearch.AUTH_PASSWORD

class Testing(object):

Expand Down