Skip to content

Commit a825844

Browse files
authored
Merge pull request #2089 from python-gitlab/jlvillal/more_time
chore(ci): increase timeout for docker container to come online
2 parents 2194a44 + bda020b commit a825844

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

tests/functional/conftest.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,13 @@ def check_is_alive():
154154
Return a healthcheck function fixture for the GitLab container spinup.
155155
"""
156156

157-
def _check(container):
158-
logging.info("Checking if GitLab container is up...")
157+
def _check(container: str, start_time: float) -> bool:
158+
setup_time = time.perf_counter() - start_time
159+
minutes, seconds = int(setup_time / 60), int(setup_time % 60)
160+
logging.info(
161+
f"Checking if GitLab container is up. "
162+
f"Have been checking for {minutes} minute(s), {seconds} seconds ..."
163+
)
159164
logs = ["docker", "logs", container]
160165
return "gitlab Reconfigured!" in check_output(logs).decode()
161166

@@ -191,11 +196,18 @@ def gitlab_config(check_is_alive, docker_ip, docker_services, temp_dir, fixture_
191196
config_file = temp_dir / "python-gitlab.cfg"
192197
port = docker_services.port_for("gitlab", 80)
193198

199+
start_time = time.perf_counter()
194200
logging.info("Waiting for GitLab container to become ready.")
195201
docker_services.wait_until_responsive(
196-
timeout=200, pause=10, check=lambda: check_is_alive("gitlab-test")
202+
timeout=300,
203+
pause=10,
204+
check=lambda: check_is_alive("gitlab-test", start_time=start_time),
205+
)
206+
setup_time = time.perf_counter() - start_time
207+
minutes, seconds = int(setup_time / 60), int(setup_time % 60)
208+
logging.info(
209+
f"GitLab container is now ready after {minutes} minute(s), {seconds} seconds"
197210
)
198-
logging.info("GitLab container is now ready.")
199211

200212
token = set_token("gitlab-test", fixture_dir=fixture_dir)
201213

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy