Skip to content

Commit bda020b

Browse files
chore(ci): increase timeout for docker container to come online
Have been seeing timeout issues more and more. Increase timeout from 200 seconds to 300 seconds (5 minutes).
1 parent f0ac3cd commit bda020b

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)