The commands these tasks run - /bin/top by default, httpd in the
ingress-port tests - install no SIGTERM handler, and a signal sent to
PID 1 has no default action. So as PID 1 they ignore the stop signal the
daemon sends them, and the daemon waits out the container's whole stop
timeout before resorting to SIGKILL, on every task teardown:
start clean shutdown of all containers with a 15 seconds timeout...
Container failed to exit within 10s of signal 15 - using the force
Daemon shutdown complete
Ten seconds a task, paid by every swarm test that stops a daemon or
removes a service. Ask for an init: it takes PID 1 and forwards the
signal to a process the default action does apply to. Note it has to be
a graceful stop to be worth anything - a container removed by force is
killed outright and waits for nothing.
Defaulting it in the spec helper reaches every test that builds a
service through it, rather than a line per caller. The iptables-doc
suite and the Init test itself build their specs by hand, so they're
handled where they are - and the case in the Init test that asserts an
unset Init delegates to the daemon configuration now asks for that
explicitly, which is what it was relying on the helper for. The
nftables-doc suite builds one too, but the only section that would use
it is commented out awaiting swarm support for nftables, so there's
nothing there to speed up yet.
Nothing here asserts on PID 1, and nothing depends on a task lingering:
the tests that care about task lifetime wait for the task count to
settle before checking anything, so a quicker drain only brings that
wait forward.
Assisted-By: Claude Opus 5
Signed-off-by: Cory Snider <csnider@mirantis.com>