docker: cap GNS3_STOP_TIMEOUT at 210 s (controller stop budget)

The 600 s clamp was unreachable in practice: the controller's stop
request times out at 240 s (controller/node.py) and the Docker stop
query gets the value +30 s as its HTTP timeout, so anything above 210
would abort upstream first and surface an error while the stop keeps
running server-side. Cap at the derived ceiling and document the chain
in the clamp and the docstring.
This commit is contained in:
YueGuobin committed 2026-08-15 01:25:50 +08:00
1 parent 9604c85fda
commit 110e041e56
3 files changed
+16 -7

No files matched your search

@@ -700,6 +700,11 @@ def test_env_stop_timeout_invalid_keeps_default(compute_project, manager):
assert vm._stop_timeout == 60
vm = _make_vm(compute_project, manager, environment="GNS3_STOP_TIMEOUT=9999")
assert vm._stop_timeout == 60
# ceiling: controller stop budget (240 s) minus the +30 s HTTP margin
vm = _make_vm(compute_project, manager, environment="GNS3_STOP_TIMEOUT=211")
assert vm._stop_timeout == 60
vm = _make_vm(compute_project, manager, environment="GNS3_STOP_TIMEOUT=210")
assert vm._stop_timeout == 210
@pytest.mark.asyncio