-
Notifications
You must be signed in to change notification settings - Fork 297
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
Starting Elasticsearch in Gitlab-CI fails #406
Comments
A version that seems to work: from testcontainers.elasticsearch import ElasticSearchContainer
from urllib.error import URLError
import logging
from testcontainers.core.waiting_utils import wait_container_is_ready
logging.basicConfig(level=logging.DEBUG)
class FixedElasticSearchContainer(ElasticSearchContainer):
@wait_container_is_ready(URLError)
def _connect(self):
return super()._connect()
with FixedElasticSearchContainer(f"elasticsearch:8.11.1") as es:
print(es.get_url()) |
hey @arian thanks for the triage for us! Sorry for the delays, but I'm focusing on #405 for the time being and did not establish the habit of triaging so folks are getting some delayed responses. From what you've said, it seems that you could just contribute the fix if you want. The fix seems simple enough! Contributions welcome! |
It seems it's fixed already actually, but not yet released: 0f9ad24 |
@arian since it's already fixed on Sorry for the delays, but still just squeezing this in our free time and operating with some restrictions (can't just change everything on the repo all at once) For further questions, please ask on #418, thanks! 🙂 |
Describe the bug
I try to use testcontainers for Elasticsearch in Gitlab-CI, but it fails when trying to connect to Elasticsearch.
To Reproduce
gitlab-ci logs
Solution?
It seems to be that the
_connect
method throws anConnectionRefusedError
orURLError
which isn't handled, which it probably should.The text was updated successfully, but these errors were encountered: