Skip to content

Commit 2d5cb3b

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 6bf9366 commit 2d5cb3b

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
@@ -212,13 +212,23 @@ test-ci-js:
212212
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
213213
--mode=release --flaky-tests=$(FLAKY_TESTS) \
214214
$(TEST_CI_ARGS) $(CI_JS_SUITES)
215+
# Clean up any leftover processes
216+
PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
217+
if [ "$${PS_OUT}" ]; then \
218+
echo $${PS_OUT} | $(XARGS) kill; exit 1; \
219+
fi
215220

216221
test-ci: LOGLEVEL := info
217222
test-ci: | build-addons
218223
out/Release/cctest --gtest_output=tap:cctest.tap
219224
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
220225
--mode=release --flaky-tests=$(FLAKY_TESTS) \
221226
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES) $(CI_JS_SUITES)
227+
# Clean up any leftover processes
228+
PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
229+
if [ "$${PS_OUT}" ]; then \
230+
echo $${PS_OUT} | $(XARGS) kill; exit 1; \
231+
fi
222232

223233
test-release: test-build
224234
$(PYTHON) tools/test.py --mode=release

0 commit comments

Comments
 (0)