Skip to content

Commit bfc553d

Browse files
TrottMylesBorins
authored andcommitted
build: fail on CI if leftover processes
If any tests leave processes running after testing results are complete, fail the test run. PR-URL: #11269 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Johan Bergström <[email protected]>
1 parent f0eee61 commit bfc553d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,22 @@ test-ci-js:
199199
$(PYTHON) tools/test.py -p tap --logfile test.tap \
200200
--mode=release --flaky-tests=$(FLAKY_TESTS) \
201201
$(TEST_CI_ARGS) $(CI_JS_SUITES)
202+
# Clean up any leftover processes
203+
PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
204+
if [ "$${PS_OUT}" ]; then \
205+
echo $${PS_OUT} | $(XARGS) kill; exit 1; \
206+
fi
202207

203208
test-ci: LOGLEVEL := info
204209
test-ci: | build-addons
205210
out/Release/cctest --gtest_output=tap:cctest.tap
206211
$(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=$(FLAKY_TESTS) \
207212
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES) $(CI_JS_SUITES)
213+
# Clean up any leftover processes
214+
PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
215+
if [ "$${PS_OUT}" ]; then \
216+
echo $${PS_OUT} | $(XARGS) kill; exit 1; \
217+
fi
208218

209219
test-release: test-build
210220
$(PYTHON) tools/test.py --mode=release

0 commit comments

Comments
 (0)