summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-01-08 20:19:20 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-02-09 03:32:52 +0000
commit33944038c68d8e497e8dd9861c5ca6c4da7d48e5 (patch)
treee967f37f54533bfcdccbdd589f5559ce09137579 /tests
parentcfd997d1c2366a4e61c39846d4d83715824302dd (diff)
downloadmeta-virtualization-33944038c68d8e497e8dd9861c5ca6c4da7d48e5.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>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_vdkr.py20
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