| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| """ | ||
| return int(super().get_exposed_port(self.port)) | ||
|
|
||
| @wait_container_is_ready(ValkeyNotReady) |
There was a problem hiding this comment.
Location: modules/valkey/testcontainers/valkey/__init__.py, line 113
Current Code:
@wait_container_is_ready(ValkeyNotReady)
def _connect(self) -> None:
"""Wait for Valkey to be ready by sending PING command."""
# ... connection logicIssue:
The @wait_container_is_ready decorator is deprecated in the codebase. Recent commits show active migration away from this pattern:
Evidence from Codebase:
# From pytest.ini_options filterwarnings:
"ignore:The @wait_container_is_ready decorator is deprecated.*:DeprecationWarning"Recommended Fix:
Migrate to modern wait strategy pattern:
from testcontainers.core.wait_strategies import ExecWaitStrategy
class ValkeyContainer(DockerContainer):
def __init__(self, image: str = "valkey/valkey:latest", port: int = 6379, **kwargs) -> None:
super().__init__(image, **kwargs)
self.port = port
self.password: Optional[str] = None
self.with_exposed_ports(self.port)
def start(self) -> "ValkeyContainer":
# Build wait strategy based on password
if self.password:
# Use custom wait strategy for authenticated connections
self.waiting_for(self._create_auth_wait_strategy())
else:
# Use exec strategy for simple PING
self.waiting_for(
ExecWaitStrategy(["valkey-cli", "ping"])
)
super().start()
return selfBenefits:
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
🤖 I have created a release *beep* *boop* --- ## [4.15.0-rc.1](testcontainers/testcontainers-python@testcontainers-v4.14.2...testcontainers-v4.15.0-rc.1) (2026-04-07) ### Features * **compose:** add structured container inspect information ([testcontainers#897](testcontainers#897)) ([58459a1](testcontainers@58459a1)) * **core:** support SSH-based DOCKER_HOST ([testcontainers#993](testcontainers#993)) ([d48115d](testcontainers@d48115d)) * **generic:** Reintroducing the generic SQL module ([testcontainers#892](testcontainers#892)) ([2ca2321](testcontainers@2ca2321)) * **keycloak:** support for relative path and management relative path ([testcontainers#982](testcontainers#982)) ([898faf6](testcontainers@898faf6)) * **mqtt:** MosquittoContainer: Add version 2.1.2 ([testcontainers#978](testcontainers#978)) ([af382f7](testcontainers@af382f7)) ### Bug Fixes * **azurite:** make visible to type checkers ([testcontainers#927](testcontainers#927)) ([baa5668](testcontainers@baa5668)) * **clickhouse:** add `HttpWaitStrategy` instead of deprecated `wait_container_is_ready` ([testcontainers#962](testcontainers#962)) ([8034541](testcontainers@8034541)) * **compose:** return type in get_service_port docstring ([testcontainers#939](testcontainers#939)) ([fed65fe](testcontainers@fed65fe)) * **core:** Refactor copy file ([testcontainers#996](testcontainers#996)) ([0e0bb24](testcontainers@0e0bb24)) * **core:** wait for ryuk more reliably, improve tests: long_running, filter logs ([testcontainers#984](testcontainers#984)) ([b12ae13](testcontainers@b12ae13)) * **generic:** Migrate ServerContainer from deprecated decorator to HttpWaitStrategy ([testcontainers#971](testcontainers#971)) ([460b0d8](testcontainers@460b0d8)) * **kafka:** Use wait strategy instead of deprecated wait_for_logs ([testcontainers#903](testcontainers#903)) ([87332c1](testcontainers@87332c1)) * **postgres:** add py.typed marker to postgres module ([testcontainers#849](testcontainers#849)) ([c8a5bbd](testcontainers@c8a5bbd)) * **qdrant:** migrate Qdrant from deprecated decorator. ([testcontainers#963](testcontainers#963)) ([407f798](testcontainers@407f798)) * **redis:** Use wait strategy instead of deprecated decorator ([testcontainers#914](testcontainers#914)) ([e25713a](testcontainers@e25713a)) * **sftp:** Avoid using wait_for_logs in module. ([testcontainers#995](testcontainers#995)) ([83157eb](testcontainers@83157eb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: David Ankin <daveankin@gmail.com>
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
…ners-python into valkey_test_container
| Back | FazBrowse Home | New Git URL |
No description provided.