Skip to content

Commit

Permalink
chore(ci): increase timeout for docker container to come online
Browse files Browse the repository at this point in the history
Have been seeing timeout issues more and more. Increase timeout from
200 seconds to 300 seconds (5 minutes).
  • Loading branch information
JohnVillalovos committed Jun 24, 2022
1 parent f0ac3cd commit bda020b
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/functional/conftest.py
Expand Up @@ -154,8 +154,13 @@ def check_is_alive():
Return a healthcheck function fixture for the GitLab container spinup.
"""

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

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

start_time = time.perf_counter()
logging.info("Waiting for GitLab container to become ready.")
docker_services.wait_until_responsive(
timeout=200, pause=10, check=lambda: check_is_alive("gitlab-test")
timeout=300,
pause=10,
check=lambda: check_is_alive("gitlab-test", start_time=start_time),
)
setup_time = time.perf_counter() - start_time
minutes, seconds = int(setup_time / 60), int(setup_time % 60)
logging.info(
f"GitLab container is now ready after {minutes} minute(s), {seconds} seconds"
)
logging.info("GitLab container is now ready.")

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

Expand Down

0 comments on commit bda020b

Please sign in to comment.