Skip to content

Commit 8d323bb

Browse files
Trottaddaleax
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 000b2a1 commit 8d323bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,23 @@ test-ci-js: | clear-stalled
297297
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
298298
--mode=release --flaky-tests=$(FLAKY_TESTS) \
299299
$(TEST_CI_ARGS) $(CI_JS_SUITES)
300+
# Clean up any leftover processes
301+
PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
302+
if [ "$${PS_OUT}" ]; then \
303+
echo $${PS_OUT} | $(XARGS) kill; exit 1; \
304+
fi
300305

301306
test-ci: LOGLEVEL := info
302307
test-ci: | clear-stalled build-addons
303308
out/Release/cctest --gtest_output=tap:cctest.tap
304309
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
305310
--mode=release --flaky-tests=$(FLAKY_TESTS) \
306311
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES) $(CI_JS_SUITES)
312+
# Clean up any leftover processes
313+
PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
314+
if [ "$${PS_OUT}" ]; then \
315+
echo $${PS_OUT} | $(XARGS) kill; exit 1; \
316+
fi
307317

308318
test-release: test-build
309319
$(PYTHON) tools/test.py --mode=release

0 commit comments

Comments
 (0)