-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Connection error with parallel testing #1709
Comments
Our test suite isn't parallelizable in all cases due to setup and teardown of the Elasticsearch server. However when I try running with what I assume is |
@sethmlarson I don't know why you closed the issue, the problem doesn't appear only with testing, it appears also when using uwsgi on multiple workers, parallel connections doesn't seem to work properly, it throws the same error and it stops the elasticsearch server |
before running uwsgi I make sure to run |
1 similar comment
before running uwsgi I make sure to run |
@mahmoudyusof Sorry for closing the issue early, you only mentioned thr test suite in your initial issue. Could you share details and code you're using for your web/worker so I can try reproducing the issue on Monday? |
Configurationsure, I am using uwsgi to serve a flask application with the configuration below [uwsgi]
wsgi-file = wsgi.py
callable = app
socket = :8080
processes = 4
threads = 2
master = true
chmod-socket = 660
vacuum = true
die-on-term = true
cheaper = 0
lazy-apps = true
enable-threads=true
die-on-term = true
need-app = true
disable-logging = true
master = true and as mentioned earlier, I make sure before running anything that the elasticsearch server is up and running CodeI am using Elasticsearch client which is, as the documentation suggests, abstracts the handling of a connection pool es = Elasticsearch("localhost:9200") I've also tried defining the client globally and tried using a list instead of a string without any luck es = Elasticsearch(["localhost:9200"]) ErrorThe code runs fine if I run flask the normal way ( |
Describe the feature:
Elasticsearch version (
bin/elasticsearch --version
): 7.14.1elasticsearch-py
version (elasticsearch.__versionstr__
): 7.14.1Description of the problem including expected versus actual behavior: When running tests sequentially using
pytest
everything works fine, however, once I try to run tests in parallel usingpytest -n=4
I get the following error:elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f201879e978>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f201879e978>: Failed to establish a new connection: [Errno 111] Connection refused)
I make sure before every test that the elasticsearch server is running, after this error I check the server status to see that is failed.
The text was updated successfully, but these errors were encountered: