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

fix: open search tests on windows #458

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/opensearch/testcontainers/opensearch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from testcontainers.core.container import DockerContainer
from testcontainers.core.utils import raise_for_deprecated_parameter
from testcontainers.core.waiting_utils import wait_container_is_ready
from testcontainers.core.waiting_utils import wait_container_is_ready, wait_for_logs


class OpenSearchContainer(DockerContainer):
Expand Down Expand Up @@ -90,16 +90,18 @@ def get_client(self, verify_certs: bool = False, **kwargs) -> OpenSearch:
**kwargs,
)

'''
@wait_container_is_ready(ConnectionError, TransportError, ProtocolError, ConnectionResetError)
def _healthcheck(self) -> None:
"""This is an internal method used to check if the OpenSearch container
is healthy and ready to receive requests."""
client: OpenSearchContainer = self.get_client()
client.cluster.health(wait_for_status="green")
'''

def start(self) -> "OpenSearchContainer":
"""This method starts the OpenSearch container and runs the healthcheck
to verify that the container is ready to use."""
super().start()
self._healthcheck()
wait_for_logs(self, "Node started")
return self
Loading