1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2024-11-22 03:46:29 +00:00

TESTS: refactor conftest.py

This commit is contained in:
Thomas LEVEIL 2017-02-11 00:51:17 +01:00
parent 3f88ba8903
commit dcf8dd4682

View File

@ -178,6 +178,7 @@ def wait_for_nginxproxy_to_be_ready():
container = containers[0] container = containers[0]
for line in docker_client.logs(container['Id'], stream=True): for line in docker_client.logs(container['Id'], stream=True):
if "Watching docker events" in line: if "Watching docker events" in line:
time.sleep(1) # give time to docker-gen to produce the new nginx config and reload nginx
logging.debug("nginx-proxy ready") logging.debug("nginx-proxy ready")
break break
@ -298,7 +299,6 @@ def docker_compose(request):
remove_all_containers() remove_all_containers()
docker_compose_up(docker_compose_file) docker_compose_up(docker_compose_file)
wait_for_nginxproxy_to_be_ready() wait_for_nginxproxy_to_be_ready()
time.sleep(3)
yield yield
docker_compose_down(docker_compose_file) docker_compose_down(docker_compose_file)
restore_urllib_dns_resolver(original_dns_resolver) restore_urllib_dns_resolver(original_dns_resolver)