Skip to content

Commit aefa89b

Browse files
committed
fix(core): wait in test core registry
1 parent 408f5c2 commit aefa89b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

core/tests/test_core_registry.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from testcontainers.core.config import testcontainers_config
1616
from testcontainers.core.container import DockerContainer
1717
from testcontainers.core.docker_client import DockerClient
18-
from testcontainers.core.waiting_utils import wait_container_is_ready
18+
from testcontainers.core.waiting_utils import wait_for_logs
1919

2020
from testcontainers.registry import DockerRegistryContainer
2121

@@ -38,18 +38,18 @@ def test_missing_on_private_registry(monkeypatch):
3838
with pytest.raises(NotFound):
3939
# Test a container with image from private registry
4040
with DockerContainer(f"{registry_url}/{image}:{tag}") as test_container:
41-
wait_container_is_ready(test_container)
41+
wait_for_logs(test_container, "Hello from Docker!")
4242

4343

4444
@pytest.mark.parametrize(
45-
"image,tag,username,password",
45+
"image,tag,username,password,expected_output",
4646
[
47-
("nginx", "test", "user", "pass"),
48-
("hello-world", "latest", "new_user", "new_pass"),
49-
("alpine", "3.12", None, None),
47+
("nginx", "test", "user", "pass", "start worker processes"),
48+
("hello-world", "latest", "new_user", "new_pass", "Hello from Docker!"),
49+
("alpine", "3.12", None, None, ""),
5050
],
5151
)
52-
def test_with_private_registry(image, tag, username, password, monkeypatch):
52+
def test_with_private_registry(image, tag, username, password, expected_output, monkeypatch):
5353
client = DockerClient().client
5454

5555
with DockerRegistryContainer(username=username, password=password) as registry:
@@ -76,7 +76,7 @@ def test_with_private_registry(image, tag, username, password, monkeypatch):
7676

7777
# Test a container with image from private registry
7878
with DockerContainer(f"{registry_url}/{image}:{tag}") as test_container:
79-
wait_container_is_ready(test_container)
79+
wait_for_logs(test_container, expected_output)
8080

8181
# cleanup
8282
client.images.remove(f"{registry_url}/{image}:{tag}")

0 commit comments

Comments
 (0)