tests: fix long shutdown times for the webhook_receiver container (#5458)

Currently, `server.py` runs as PID 1, which means that it won't be
terminated by a `SIGTERM` signal unless it explicitly handles it (which
it doesn't). So when Docker tries to shut the container down, it sends
the server a `SIGTERM`, which gets ignored, and then sits there for 10
seconds before sending it a `SIGKILL`.

To work around this, enable the built-in Docker init program, which
forwards signals to the Python server. Since the Python server is no
longer PID 1, `SIGTERM` will now shut it down immediately.

The `init` option is supported starting from the Compose format version
3.7, so bump the version.
main
Roman Donchenko 3 years ago committed by GitHub
parent 6be7e4cceb
commit 7b13216e2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,10 +1,11 @@
version: '3.3'
version: '3.7'
services:
webhook_receiver:
image: python:3.9-slim
restart: always
command: python3 /tmp/server.py
init: true
env_file:
- ./tests/python/webhook_receiver/.env
expose:

Loading…
Cancel
Save