Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
apparently this matters now
  • Loading branch information
alexanderankin committed Oct 3, 2025
commit dc9df40174ac849f7ce074c7d32298ba319f46b1
7 changes: 4 additions & 3 deletions core/testcontainers/core/waiting_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from typing import Any, Callable, Optional, Protocol, TypeVar, Union, cast

import wrapt
from typing_extensions import Self

from testcontainers.core.config import testcontainers_config
from testcontainers.core.utils import setup_logger
Expand Down Expand Up @@ -77,23 +78,23 @@ def __init__(self) -> None:
self._poll_interval: float = testcontainers_config.sleep_time
self._transient_exceptions: list[type[Exception]] = [*TRANSIENT_EXCEPTIONS]

def with_startup_timeout(self, timeout: Union[int, timedelta]) -> "WaitStrategy":
def with_startup_timeout(self, timeout: Union[int, timedelta]) -> Self:
"""Set the maximum time to wait for the container to be ready."""
if isinstance(timeout, timedelta):
self._startup_timeout = float(int(timeout.total_seconds()))
else:
self._startup_timeout = float(timeout)
return self

def with_poll_interval(self, interval: Union[float, timedelta]) -> "WaitStrategy":
def with_poll_interval(self, interval: Union[float, timedelta]) -> Self:
"""Set how frequently to check if the container is ready."""
if isinstance(interval, timedelta):
self._poll_interval = interval.total_seconds()
else:
self._poll_interval = interval
return self

def with_transient_exceptions(self, *transient_exceptions: type[Exception]) -> "WaitStrategy":
def with_transient_exceptions(self, *transient_exceptions: type[Exception]) -> Self:
self._transient_exceptions.extend(transient_exceptions)
return self

Expand Down
Loading