| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f0ac3cd commit bda020b
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -154,8 +154,13 @@ def check_is_alive(): | |||
| 154 | 154 | Return a healthcheck function fixture for the GitLab container spinup. | |
| 155 | 155 | """ | |
| 156 | 156 | ||
| 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 | + ) | ||
| 159 | 164 | logs = ["docker", "logs", container] | |
| 160 | 165 | return "gitlab Reconfigured!" in check_output(logs).decode() | |
| 161 | 166 | ||
@@ -191,11 +196,18 @@ def gitlab_config(check_is_alive, docker_ip, docker_services, temp_dir, fixture_ | |||
| 191 | 196 | config_file = temp_dir / "python-gitlab.cfg" | |
| 192 | 197 | port = docker_services.port_for("gitlab", 80) | |
| 193 | 198 | ||
| 199 | + start_time = time.perf_counter() | ||
| 194 | 200 | logging.info("Waiting for GitLab container to become ready.") | |
| 195 | 201 | 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" | ||
| 197 | 210 | ) | |
| 198 | - logging.info("GitLab container is now ready.") | ||
| 199 | 211 | ||
| 200 | 212 | token = set_token("gitlab-test", fixture_dir=fixture_dir) | |
| 201 | 213 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments