Hashar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389937 )

Change subject: docker: handle signals in tox entrypoint
......................................................................

docker: handle signals in tox entrypoint

Change-Id: I44d7c4309a70170d9c93feea5c67569122635b6a
---
M dockerfiles/tox/run.sh
1 file changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/37/389937/1

diff --git a/dockerfiles/tox/run.sh b/dockerfiles/tox/run.sh
index 2abd52b..9b46c40 100755
--- a/dockerfiles/tox/run.sh
+++ b/dockerfiles/tox/run.sh
@@ -23,6 +23,18 @@
 
 trap capture_tox_logs EXIT
 
-# Run tests. Pass all environment variables to tox since the environment here
-# is already pretty restrictive.
-TOX_TESTENV_PASSENV="*" PY_COLORS=1 tox -v
+function relay_signals() {
+    for signal ; do
+        trap 'kill -$signal $tox_pid; wait $tox_pid' "$signal"
+    done
+}
+
+# Run tests.
+# Pass all environment variables to tox since the environment here is already
+# pretty restrictive.
+# tox is backgrounded in bash job control to let bash handles traps (eg
+# SIGTERM) immediately
+TOX_TESTENV_PASSENV="*" PY_COLORS=1 tox -v &
+tox_pid=$!
+relay_signals SIGINT SIGTERM
+wait "$tox_pid"

-- 
To view, visit https://gerrit.wikimedia.org/r/389937
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44d7c4309a70170d9c93feea5c67569122635b6a
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to