|
7 | 7 | from datetime import timedelta |
8 | 8 | from io import BytesIO |
9 | 9 | from typing import Any |
| 10 | +from typing import Final |
10 | 11 | from typing import Optional |
11 | 12 |
|
12 | 13 | from packaging import version |
|
16 | 17 | from tests.integration.test_utils import podman_compose_path |
17 | 18 | from tests.integration.test_utils import test_path |
18 | 19 |
|
| 20 | +EXECUTION_TIMEOUT: Final[float] = 30 |
| 21 | + |
19 | 22 |
|
20 | 23 | def compose_yaml_path() -> str: |
21 | 24 | return os.path.join(test_path(), "wait", "docker-compose.yml") |
@@ -119,14 +122,17 @@ def test_wait(self) -> None: |
119 | 122 | # the execution time of this command must be at least 10 seconds, |
120 | 123 | # because of the sleep command in entrypoint.sh |
121 | 124 | with ExecutionTime(min_execution_time=timedelta(seconds=10)): |
122 | | - self.run_subprocess_assert_returncode([ |
123 | | - podman_compose_path(), |
124 | | - "-f", |
125 | | - compose_yaml_path(), |
126 | | - "up", |
127 | | - "-d", |
128 | | - "--wait", |
129 | | - ]) |
| 125 | + self.run_subprocess_assert_returncode( |
| 126 | + [ |
| 127 | + podman_compose_path(), |
| 128 | + "-f", |
| 129 | + compose_yaml_path(), |
| 130 | + "up", |
| 131 | + "-d", |
| 132 | + "--wait", |
| 133 | + ], |
| 134 | + timeout=EXECUTION_TIMEOUT, |
| 135 | + ) |
130 | 136 |
|
131 | 137 | output, _ = self.run_subprocess_assert_returncode([ |
132 | 138 | podman_compose_path(), |
@@ -155,16 +161,19 @@ def test_wait_with_timeout(self) -> None: |
155 | 161 | with ExecutionTime( |
156 | 162 | min_execution_time=timedelta(seconds=5), max_execution_time=timedelta(seconds=10) |
157 | 163 | ): |
158 | | - self.run_subprocess_assert_returncode([ |
159 | | - podman_compose_path(), |
160 | | - "-f", |
161 | | - compose_yaml_path(), |
162 | | - "up", |
163 | | - "-d", |
164 | | - "--wait", |
165 | | - "--wait-timeout", |
166 | | - "5", |
167 | | - ]) |
| 164 | + self.run_subprocess_assert_returncode( |
| 165 | + [ |
| 166 | + podman_compose_path(), |
| 167 | + "-f", |
| 168 | + compose_yaml_path(), |
| 169 | + "up", |
| 170 | + "-d", |
| 171 | + "--wait", |
| 172 | + "--wait-timeout", |
| 173 | + "5", |
| 174 | + ], |
| 175 | + timeout=EXECUTION_TIMEOUT, |
| 176 | + ) |
168 | 177 |
|
169 | 178 | output, _ = self.run_subprocess_assert_returncode([ |
170 | 179 | podman_compose_path(), |
@@ -224,13 +233,16 @@ def test_wait_with_start(self) -> None: |
224 | 233 | # the execution time of this command must be at least 10 seconds, |
225 | 234 | # because of the sleep command in entrypoint.sh |
226 | 235 | with ExecutionTime(min_execution_time=timedelta(seconds=10)): |
227 | | - self.run_subprocess_assert_returncode([ |
228 | | - podman_compose_path(), |
229 | | - "-f", |
230 | | - compose_yaml_path(), |
231 | | - "start", |
232 | | - "--wait", |
233 | | - ]) |
| 236 | + self.run_subprocess_assert_returncode( |
| 237 | + [ |
| 238 | + podman_compose_path(), |
| 239 | + "-f", |
| 240 | + compose_yaml_path(), |
| 241 | + "start", |
| 242 | + "--wait", |
| 243 | + ], |
| 244 | + timeout=EXECUTION_TIMEOUT, |
| 245 | + ) |
234 | 246 |
|
235 | 247 | self.assertTrue(self._is_running("wait_app_1")) |
236 | 248 |
|
|
0 commit comments