Skip to content

Commit 2d0c336

Browse files
trevnorrisaddaleax
authored andcommitted
build: add test-with-async-hooks
The new test-with-async-hooks runs all normal tests (except async-hooks) with the environment variable NODE_TEST_WITH_ASYNC_HOOKS set. These extra checks do a minimum check to make sure async_hooks operates normally under all other tests. e.g. if init() or destroy() is called twice for the same id. Also move test "async-hooks" from CI_JS_SUITES into its own CI_ASYNC_HOOKS. Makes it cleaner to add, instead of supplying a massive list of tests that may change in the future. PR-URL: nodejs/node#14208 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent f0f1053 commit 2d0c336

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ test: all
205205
$(MAKE) build-addons-napi
206206
$(MAKE) cctest
207207
$(PYTHON) tools/test.py --mode=release -J \
208+
$(CI_ASYNC_HOOKS) \
208209
$(CI_JS_SUITES) \
209210
$(CI_NATIVE_SUITES)
210211
$(MAKE) lint
@@ -337,7 +338,8 @@ test-all-valgrind: test-build
337338
$(PYTHON) tools/test.py --mode=debug,release --valgrind
338339

339340
CI_NATIVE_SUITES := addons addons-napi
340-
CI_JS_SUITES := abort async-hooks doctool inspector known_issues message parallel pseudo-tty sequential
341+
CI_ASYNC_HOOKS := async-hooks
342+
CI_JS_SUITES := abort doctool inspector known_issues message parallel pseudo-tty sequential
341343

342344
# Build and test addons without building anything else
343345
test-ci-native: LOGLEVEL := silent
@@ -350,7 +352,7 @@ test-ci-native: | test/addons/.buildstamp test/addons-napi/.buildstamp
350352
test-ci-js: | clear-stalled
351353
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
352354
--mode=release --flaky-tests=$(FLAKY_TESTS) \
353-
$(TEST_CI_ARGS) $(CI_JS_SUITES)
355+
$(TEST_CI_ARGS) $(CI_ASYNC_HOOKS) $(CI_JS_SUITES)
354356
# Clean up any leftover processes, error if found.
355357
ps awwx | grep Release/node | grep -v grep | cat
356358
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
@@ -363,7 +365,7 @@ test-ci: | clear-stalled build-addons build-addons-napi
363365
out/Release/cctest --gtest_output=tap:cctest.tap
364366
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p oneline \
365367
--mode=release --flaky-tests=$(FLAKY_TESTS) \
366-
$(TEST_CI_ARGS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES)
368+
$(TEST_CI_ARGS) $(CI_ASYNC_HOOKS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES)
367369
# Clean up any leftover processes, error if found.
368370
ps awwx | grep Release/node | grep -v grep | cat
369371
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
@@ -437,6 +439,14 @@ test-timers-clean:
437439
test-async-hooks:
438440
$(PYTHON) tools/test.py --mode=release async-hooks
439441

442+
test-with-async-hooks:
443+
$(MAKE) build-addons
444+
$(MAKE) build-addons-napi
445+
$(MAKE) cctest
446+
NODE_TEST_WITH_ASYNC_HOOKS=1 $(PYTHON) tools/test.py --mode=release -J \
447+
$(CI_JS_SUITES) \
448+
$(CI_NATIVE_SUITES)
449+
440450

441451
ifneq ("","$(wildcard deps/v8/tools/run-tests.py)")
442452
test-v8: v8

0 commit comments

Comments
 (0)