diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-08 20:19:20 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-21 18:00:26 -0500 |
| commit | 20b59031dd03283d464802f5d820539dfd54c77a (patch) | |
| tree | ef1cc634a730478db25f0f53649a5d447db2185d | |
| parent | 807d2afdd1cc11acc6eb434f053ab5fed40e220a (diff) | |
| download | meta-virtualization-20b59031dd03283d464802f5d820539dfd54c77a.tar.gz | |
tests: increase stop command timeouts to 30 seconds
Docker stop has a default 10-second grace period before SIGKILL, so
test timeouts of 10 seconds were insufficient. Increase all stop
timeouts to 30 seconds to account for the grace period plus command
overhead.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | tests/test_vdkr.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_vdkr.py b/tests/test_vdkr.py index bee261fb..1aa08cbf 100644 --- a/tests/test_vdkr.py +++ b/tests/test_vdkr.py | |||
| @@ -131,7 +131,7 @@ class TestPortForwarding: | |||
| 131 | ps_result = vdkr.run("ps", "-q", check=False) | 131 | ps_result = vdkr.run("ps", "-q", check=False) |
| 132 | if ps_result.stdout.strip(): | 132 | if ps_result.stdout.strip(): |
| 133 | for container_id in ps_result.stdout.strip().split('\n'): | 133 | for container_id in ps_result.stdout.strip().split('\n'): |
| 134 | vdkr.run("stop", container_id, timeout=10, check=False) | 134 | vdkr.run("stop", container_id, timeout=30, check=False) |
| 135 | 135 | ||
| 136 | # Stop memres | 136 | # Stop memres |
| 137 | vdkr.memres_stop() | 137 | vdkr.memres_stop() |
| @@ -197,8 +197,8 @@ class TestPortForwarding: | |||
| 197 | 197 | ||
| 198 | finally: | 198 | finally: |
| 199 | # Clean up | 199 | # Clean up |
| 200 | vdkr.run("stop", "nginx1", timeout=10, check=False) | 200 | vdkr.run("stop", "nginx1", timeout=30, check=False) |
| 201 | vdkr.run("stop", "nginx2", timeout=10, check=False) | 201 | vdkr.run("stop", "nginx2", timeout=30, check=False) |
| 202 | vdkr.run("rm", "-f", "nginx1", check=False) | 202 | vdkr.run("rm", "-f", "nginx1", check=False) |
| 203 | vdkr.run("rm", "-f", "nginx2", check=False) | 203 | vdkr.run("rm", "-f", "nginx2", check=False) |
| 204 | vdkr.memres_stop() | 204 | vdkr.memres_stop() |
| @@ -263,7 +263,7 @@ class TestPortForwarding: | |||
| 263 | if ps_result.stdout.strip(): | 263 | if ps_result.stdout.strip(): |
| 264 | for container_id in ps_result.stdout.strip().split('\n'): | 264 | for container_id in ps_result.stdout.strip().split('\n'): |
| 265 | if container_id.strip(): | 265 | if container_id.strip(): |
| 266 | vdkr.run("stop", container_id, timeout=10, check=False) | 266 | vdkr.run("stop", container_id, timeout=30, check=False) |
| 267 | vdkr.memres_stop() | 267 | vdkr.memres_stop() |
| 268 | 268 | ||
| 269 | 269 | ||
| @@ -1029,7 +1029,7 @@ class TestDynamicPortForwarding: | |||
| 1029 | 1029 | ||
| 1030 | finally: | 1030 | finally: |
| 1031 | # Clean up | 1031 | # Clean up |
| 1032 | vdkr.run("stop", "nginx-test", timeout=10, check=False) | 1032 | vdkr.run("stop", "nginx-test", timeout=30, check=False) |
| 1033 | vdkr.run("rm", "-f", "nginx-test", check=False) | 1033 | vdkr.run("rm", "-f", "nginx-test", check=False) |
| 1034 | 1034 | ||
| 1035 | def test_port_forward_cleanup_on_stop(self, memres_session): | 1035 | def test_port_forward_cleanup_on_stop(self, memres_session): |
| @@ -1045,8 +1045,8 @@ class TestDynamicPortForwarding: | |||
| 1045 | "busybox:latest", "sleep", "300", timeout=60, check=False) | 1045 | "busybox:latest", "sleep", "300", timeout=60, check=False) |
| 1046 | 1046 | ||
| 1047 | if result.returncode == 0: | 1047 | if result.returncode == 0: |
| 1048 | # Stop the container | 1048 | # Stop the container (docker stop has 10s grace period, so need longer timeout) |
| 1049 | vdkr.run("stop", "port-test", timeout=10, check=False) | 1049 | vdkr.run("stop", "port-test", timeout=30, check=False) |
| 1050 | 1050 | ||
| 1051 | # Check ps - port forward should be removed | 1051 | # Check ps - port forward should be removed |
| 1052 | ps_result = vdkr.run("ps") | 1052 | ps_result = vdkr.run("ps") |
| @@ -1107,15 +1107,15 @@ class TestDynamicPortForwarding: | |||
| 1107 | assert ps_result.returncode == 0 | 1107 | assert ps_result.returncode == 0 |
| 1108 | 1108 | ||
| 1109 | # Stop first - second should still work | 1109 | # Stop first - second should still work |
| 1110 | vdkr.run("stop", "http1", timeout=10, check=False) | 1110 | vdkr.run("stop", "http1", timeout=30, check=False) |
| 1111 | 1111 | ||
| 1112 | # Check ps - only second port forward should remain | 1112 | # Check ps - only second port forward should remain |
| 1113 | ps_result = vdkr.run("ps") | 1113 | ps_result = vdkr.run("ps") |
| 1114 | # http1's port should be cleaned up, http2 should remain | 1114 | # http1's port should be cleaned up, http2 should remain |
| 1115 | 1115 | ||
| 1116 | finally: | 1116 | finally: |
| 1117 | vdkr.run("stop", "http1", timeout=10, check=False) | 1117 | vdkr.run("stop", "http1", timeout=30, check=False) |
| 1118 | vdkr.run("stop", "http2", timeout=10, check=False) | 1118 | vdkr.run("stop", "http2", timeout=30, check=False) |
| 1119 | vdkr.run("rm", "-f", "http1", check=False) | 1119 | vdkr.run("rm", "-f", "http1", check=False) |
| 1120 | vdkr.run("rm", "-f", "http2", check=False) | 1120 | vdkr.run("rm", "-f", "http2", check=False) |
| 1121 | 1121 | ||
