From db5c314dafde7634b5e368fbcbc07e68223b4ec4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 9 Feb 2017 10:42:29 -0800 Subject: [PATCH] build: fail on CI if leftover processes If any tests leave processes running after testing results are complete, fail the test run. --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 9c28a3e4f4f88e..6c342753b80696 100644 --- a/Makefile +++ b/Makefile @@ -290,6 +290,11 @@ test-ci-js: | clear-stalled $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=release --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) $(CI_JS_SUITES) + # Clean up any leftover processes + PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \ + if [ "$${PS_OUT}" ]; then \ + echo $${PS_OUT} | $(XARGS) kill; exit 1; \ + fi test-ci: LOGLEVEL := info test-ci: | clear-stalled build-addons @@ -297,6 +302,11 @@ test-ci: | clear-stalled build-addons $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=release --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) $(CI_NATIVE_SUITES) $(CI_JS_SUITES) + # Clean up any leftover processes + PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \ + if [ "$${PS_OUT}" ]; then \ + echo $${PS_OUT} | $(XARGS) kill; exit 1; \ + fi test-release: test-build $(PYTHON) tools/test.py --mode=release