Skip to content

Commit 6f270a0

Browse files
Make TC_POOLING_INTERVAL/sleep_time a float
This config variable gets passed into `time.sleep`, which can work with ints and floats. Making this a float type allows polling intervals under a second, which can reduce startup times for containers that spin up very quickly.
1 parent 003046b commit 6f270a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/testcontainers/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def read_tc_properties() -> dict[str, str]:
9797
@dataclass
9898
class TestcontainersConfiguration:
9999
max_tries: int = int(environ.get("TC_MAX_TRIES", "120"))
100-
sleep_time: int = int(environ.get("TC_POOLING_INTERVAL", "1"))
100+
sleep_time: float = float(environ.get("TC_POOLING_INTERVAL", "1"))
101101
ryuk_image: str = environ.get("RYUK_CONTAINER_IMAGE", "testcontainers/ryuk:0.8.1")
102102
ryuk_privileged: bool = get_bool_env("TESTCONTAINERS_RYUK_PRIVILEGED")
103103
ryuk_disabled: bool = get_bool_env("TESTCONTAINERS_RYUK_DISABLED")

0 commit comments

Comments
 (0)