Skip to content

Commit 81515c7

Browse files
trevnorrisMylesBorins
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: #14208 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent 44ea525 commit 81515c7

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ test: all
202202
$(MAKE) build-addons-napi
203203
$(MAKE) cctest
204204
$(PYTHON) tools/test.py --mode=release -J \
205+
$(CI_ASYNC_HOOKS) \
205206
$(CI_JS_SUITES) \
206207
$(CI_NATIVE_SUITES)
207208
$(MAKE) lint
@@ -334,7 +335,8 @@ test-all-valgrind: test-build
334335
$(PYTHON) tools/test.py --mode=debug,release --valgrind
335336

336337
CI_NATIVE_SUITES := addons addons-napi
337-
CI_JS_SUITES := abort async-hooks doctool inspector known_issues message parallel pseudo-tty sequential
338+
CI_ASYNC_HOOKS := async-hooks
339+
CI_JS_SUITES := abort doctool inspector known_issues message parallel pseudo-tty sequential
338340

339341
# Build and test addons without building anything else
340342
test-ci-native: LOGLEVEL := info
@@ -347,7 +349,7 @@ test-ci-native: | test/addons/.buildstamp test/addons-napi/.buildstamp
347349
test-ci-js: | clear-stalled
348350
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
349351
--mode=release --flaky-tests=$(FLAKY_TESTS) \
350-
$(TEST_CI_ARGS) $(CI_JS_SUITES)
352+
$(TEST_CI_ARGS) $(CI_ASYNC_HOOKS) $(CI_JS_SUITES)
351353
# Clean up any leftover processes, error if found.
352354
ps awwx | grep Release/node | grep -v grep | cat
353355
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
@@ -360,7 +362,7 @@ test-ci: | clear-stalled build-addons build-addons-napi
360362
out/Release/cctest --gtest_output=tap:cctest.tap
361363
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
362364
--mode=release --flaky-tests=$(FLAKY_TESTS) \
363-
$(TEST_CI_ARGS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES)
365+
$(TEST_CI_ARGS) $(CI_ASYNC_HOOKS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES)
364366
# Clean up any leftover processes, error if found.
365367
ps awwx | grep Release/node | grep -v grep | cat
366368
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
@@ -434,6 +436,14 @@ test-timers-clean:
434436
test-async-hooks:
435437
$(PYTHON) tools/test.py --mode=release async-hooks
436438

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

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

0 commit comments

Comments
 (0)