Skip to content

Commit a172f45

Browse files
Trottkrydos
authored andcommitted
build: clear stalled jobs on POSIX CI hosts
Sometimes, after a cluster or debug test fails, a fixture hangs around and holds onto a needed port, causing subsequent CI runs to fail. This adds a command I've been running manually when this occurs. The command will clear the stalled jobs before a CI run. PR-URL: nodejs#11246 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Josh Gavant <[email protected]>
1 parent 7dc1b50 commit a172f45

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Makefile

+12-3
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ test/addons/.buildstamp: config.gypi \
188188
# TODO(bnoordhuis) Force rebuild after gyp update.
189189
build-addons: $(NODE_EXE) test/addons/.buildstamp
190190

191+
ifeq ($(OSTYPE),$(filter $(OSTYPE),darwin aix))
192+
XARGS = xargs
193+
else
194+
XARGS = xargs -r
195+
endif
196+
clear-stalled:
197+
ps awwx | grep Release/node | grep -v grep | cat
198+
ps awwx | grep Release/node | grep -v grep | awk '{print $$1}' | $(XARGS) kill
199+
191200
test-gc: all test/gc/node_modules/weak/build/Release/weakref.node
192201
$(PYTHON) tools/test.py --mode=release gc
193202

@@ -210,13 +219,13 @@ test-ci-native: | test/addons/.buildstamp
210219
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES)
211220

212221
# This target should not use a native compiler at all
213-
test-ci-js:
222+
test-ci-js: | clear-stalled
214223
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
215224
--mode=release --flaky-tests=$(FLAKY_TESTS) \
216225
$(TEST_CI_ARGS) $(CI_JS_SUITES)
217226

218227
test-ci: LOGLEVEL := info
219-
test-ci: | build-addons
228+
test-ci: | clear-stalled build-addons
220229
out/Release/cctest --gtest_output=tap:cctest.tap
221230
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
222231
--mode=release --flaky-tests=$(FLAKY_TESTS) \
@@ -764,4 +773,4 @@ endif
764773
bench-all bench bench-misc bench-array bench-buffer bench-net \
765774
bench-http bench-fs bench-tls cctest run-ci test-v8 test-v8-intl \
766775
test-v8-benchmarks test-v8-all v8 lint-ci bench-ci jslint-ci doc-only \
767-
$(TARBALL)-headers test-ci test-ci-native test-ci-js build-ci
776+
$(TARBALL)-headers test-ci test-ci-native test-ci-js build-ci clear-stalled

0 commit comments

Comments
 (0)