Skip to content

Commit 0beffc0

Browse files
addaleaxtargos
authored andcommitted
test: remove test/gc, integrate into parallel
There’s no reason to have a separate addon just for testing GC anymore. PR-URL: #22001 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 29bc553 commit 0beffc0

13 files changed

+23
-152
lines changed

Makefile

+1-19
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,6 @@ benchmark/napi/function_args/build/Release/binding.node: all \
314314
--directory="$(shell pwd)/benchmark/napi/function_args" \
315315
--nodedir="$(shell pwd)"
316316

317-
# Implicitly depends on $(NODE_EXE). We don't depend on it explicitly because
318-
# it always triggers a rebuild due to it being a .PHONY rule. See the comment
319-
# near the build-addons rule for more background.
320-
test/gc/build/Release/binding.node: test/gc/binding.cc test/gc/binding.gyp
321-
$(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
322-
--python="$(PYTHON)" \
323-
--directory="$(shell pwd)/test/gc" \
324-
--nodedir="$(shell pwd)"
325-
326317
DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.js doc/api/addons.md
327318

328319
ifeq ($(OSTYPE),aix)
@@ -405,20 +396,12 @@ clear-stalled:
405396
echo $${PS_OUT} | xargs kill -9; \
406397
fi
407398

408-
.PHONY: test-gc
409-
test-gc: all test/gc/build/Release/binding.node
410-
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) gc
411-
412-
.PHONY: test-gc-clean
413-
test-gc-clean:
414-
$(RM) -r test/gc/build
415-
416399
test-build: | all build-addons build-addons-napi
417400

418401
test-build-addons-napi: all build-addons-napi
419402

420403
.PHONY: test-all
421-
test-all: test-build test/gc/build/Release/binding.node ## Run everything in test/.
404+
test-all: test-build ## Run everything in test/.
422405
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=debug,release
423406

424407
test-all-valgrind: test-build
@@ -1185,7 +1168,6 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
11851168
test/cctest/*.h \
11861169
test/addons-napi/*/*.cc \
11871170
test/addons-napi/*/*.h \
1188-
test/gc/binding.cc \
11891171
tools/icu/*.cc \
11901172
tools/icu/*.h \
11911173
))

test/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ GitHub with the `autocrlf` git config flag set to true.
2121
|common | |Common modules shared among many tests. [Documentation](./common/README.md)|
2222
|es-module |Yes |Test ESM module loading.|
2323
|fixtures | |Test fixtures used in various tests throughout the test suite.|
24-
|gc |No |Tests for garbage collection related functionality.|
2524
|internet |No |Tests that make real outbound connections (mainly networking related modules). Tests for networking related modules may also be present in other directories, but those tests do not make outbound connections.|
2625
|known_issues |Yes |Tests reproducing known issues within the system. All tests inside of this directory are expected to fail consistently. If a test doesn't fail on certain platforms, those should be skipped via `known_issues.status`.|
2726
|message |Yes |Tests for messages that are output for various conditions (```console.log```, error messages etc.)|

test/gc/.gitignore

-1
This file was deleted.

test/gc/binding.cc

-80
This file was deleted.

test/gc/binding.gyp

-9
This file was deleted.

test/gc/testcfg.py

-6
This file was deleted.

test/gc/test-http-client-connaborted.js test/parallel/test-gc-http-client-connaborted.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
2-
// just like test/gc/http-client.js,
2+
// Flags: --expose-gc
3+
// just like test-gc-http-client.js,
34
// but aborting every connection that comes in.
45

56
const common = require('../common');
@@ -9,7 +10,6 @@ function serverHandler(req, res) {
910
}
1011

1112
const http = require('http');
12-
const weak = require(`./build/${common.buildType}/binding`);
1313
const todo = 500;
1414
let done = 0;
1515
let count = 0;
@@ -36,7 +36,7 @@ function getall() {
3636
}, cb).on('error', cb);
3737

3838
count++;
39-
weak(req, afterGC);
39+
common.onGC(req, { ongc });
4040
})();
4141

4242
setImmediate(getall);
@@ -45,7 +45,7 @@ function getall() {
4545
for (let i = 0; i < 10; i++)
4646
getall();
4747

48-
function afterGC() {
48+
function ongc() {
4949
countGC++;
5050
}
5151

test/gc/test-http-client-onerror.js test/parallel/test-gc-http-client-onerror.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
2-
// just like test/gc/http-client.js,
2+
// Flags: --expose-gc
3+
// just like test-gc-http-client.js,
34
// but with an on('error') handler that does nothing.
45

56
const common = require('../common');
@@ -11,7 +12,6 @@ function serverHandler(req, res) {
1112
}
1213

1314
const http = require('http');
14-
const weak = require(`./build/${common.buildType}/binding`);
1515
const todo = 500;
1616
let done = 0;
1717
let count = 0;
@@ -42,7 +42,7 @@ function getall() {
4242
}, cb).on('error', onerror);
4343

4444
count++;
45-
weak(req, afterGC);
45+
common.onGC(req, { ongc });
4646
})();
4747

4848
setImmediate(getall);
@@ -53,7 +53,7 @@ function runTest() {
5353
getall();
5454
}
5555

56-
function afterGC() {
56+
function ongc() {
5757
countGC++;
5858
}
5959

test/gc/test-http-client-timeout.js test/parallel/test-gc-http-client-timeout.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
2-
// just like test/gc/http-client.js,
2+
// Flags: --expose-gc
3+
// just like test-gc-http-client.js,
34
// but with a timeout set
45

56
const common = require('../common');
@@ -13,7 +14,6 @@ function serverHandler(req, res) {
1314
}
1415

1516
const http = require('http');
16-
const weak = require(`./build/${common.buildType}/binding`);
1717
const todo = 550;
1818
let done = 0;
1919
let count = 0;
@@ -45,7 +45,7 @@ function getall() {
4545
});
4646

4747
count++;
48-
weak(req, afterGC);
48+
common.onGC(req, { ongc });
4949
})();
5050

5151
setImmediate(getall);
@@ -54,7 +54,7 @@ function getall() {
5454
for (let i = 0; i < 10; i++)
5555
getall();
5656

57-
function afterGC() {
57+
function ongc() {
5858
countGC++;
5959
}
6060

test/gc/test-http-client.js test/parallel/test-gc-http-client.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict';
2+
// Flags: --expose-gc
23
// just a simple http server and client.
34

45
const common = require('../common');
@@ -9,7 +10,6 @@ function serverHandler(req, res) {
910
}
1011

1112
const http = require('http');
12-
const weak = require(`./build/${common.buildType}/binding`);
1313
const todo = 500;
1414
let done = 0;
1515
let count = 0;
@@ -40,7 +40,7 @@ function getall() {
4040
}, cb);
4141

4242
count++;
43-
weak(req, afterGC);
43+
common.onGC(req, { ongc });
4444
})();
4545

4646
setImmediate(getall);
@@ -49,7 +49,7 @@ function getall() {
4949
for (let i = 0; i < 10; i++)
5050
getall();
5151

52-
function afterGC() {
52+
function ongc() {
5353
countGC++;
5454
}
5555

test/gc/test-net-timeout.js test/parallel/test-gc-net-timeout.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
2-
// just like test/gc/http-client-timeout.js,
2+
// Flags: --expose-gc
3+
// just like test-gc-http-client-timeout.js,
34
// but using a net server/client instead
45

56
const common = require('../common');
@@ -19,7 +20,6 @@ function serverHandler(sock) {
1920
}
2021

2122
const net = require('net');
22-
const weak = require(`./build/${common.buildType}/binding`);
2323
const assert = require('assert');
2424
const todo = 500;
2525
let done = 0;
@@ -44,15 +44,15 @@ function getall() {
4444
});
4545

4646
count++;
47-
weak(req, afterGC);
47+
common.onGC(req, { ongc });
4848

4949
setImmediate(getall);
5050
}
5151

5252
for (let i = 0; i < 10; i++)
5353
getall();
5454

55-
function afterGC() {
55+
function ongc() {
5656
countGC++;
5757
}
5858

tools/test.py

-1
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,6 @@ def PrintCrashed(code):
15381538
'addons-napi',
15391539
'code-cache',
15401540
'doctool',
1541-
'gc',
15421541
'internet',
15431542
'pummel',
15441543
'test-known-issues',

vcbuild.bat

+3-16
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ set lint_js=
3333
set lint_cpp=
3434
set lint_md=
3535
set lint_md_build=
36-
set build_testgc_addon=
3736
set noetw=
3837
set noetw_msi_arg=
3938
set noperfctr=
@@ -88,13 +87,12 @@ if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&
8887
if /i "%1"=="test-addons-napi" set test_args=%test_args% addons-napi&set build_addons_napi=1&goto arg-ok
8988
if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok
9089
if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok
91-
if /i "%1"=="test-gc" set test_args=%test_args% gc&set build_testgc_addon=1&goto arg-ok
9290
if /i "%1"=="test-tick-processor" set test_args=%test_args% tick-processor&goto arg-ok
9391
if /i "%1"=="test-internet" set test_args=%test_args% internet&goto arg-ok
9492
if /i "%1"=="test-pummel" set test_args=%test_args% pummel&goto arg-ok
9593
if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues&goto arg-ok
9694
if /i "%1"=="test-async-hooks" set test_args=%test_args% async-hooks&goto arg-ok
97-
if /i "%1"=="test-all" set test_args=%test_args% gc internet pummel %common_test_suites%&set build_testgc_addon=1&set lint_cpp=1&set lint_js=1&goto arg-ok
95+
if /i "%1"=="test-all" set test_args=%test_args% gc internet pummel %common_test_suites%&set lint_cpp=1&set lint_js=1&goto arg-ok
9896
if /i "%1"=="test-node-inspect" set test_node_inspect=1&goto arg-ok
9997
if /i "%1"=="test-check-deopts" set test_check_deopts=1&goto arg-ok
10098
if /i "%1"=="test-npm" set test_npm=1&goto arg-ok
@@ -468,17 +466,6 @@ for %%F in (%config%\doc\api\*.md) do (
468466
:run
469467
@rem Run tests if requested.
470468

471-
@rem Build test/gc add-on if required.
472-
if "%build_testgc_addon%"=="" goto build-addons
473-
%node_gyp_exe% rebuild --directory="%~dp0test\gc" --nodedir="%~dp0."
474-
if errorlevel 1 goto build-testgc-addon-failed
475-
goto build-addons
476-
477-
:build-testgc-addon-failed
478-
echo Failed to build test/gc add-on."
479-
goto exit
480-
481-
:build-addons
482469
if not defined build_addons goto build-addons-napi
483470
if not exist "%node_exe%" (
484471
echo Failed to find node.exe
@@ -561,7 +548,7 @@ goto lint-cpp
561548

562549
:lint-cpp
563550
if not defined lint_cpp goto lint-js
564-
call :run-lint-cpp src\*.c src\*.cc src\*.h test\addons\*.cc test\addons\*.h test\addons-napi\*.cc test\addons-napi\*.h test\cctest\*.cc test\cctest\*.h test\gc\binding.cc tools\icu\*.cc tools\icu\*.h
551+
call :run-lint-cpp src\*.c src\*.cc src\*.h test\addons\*.cc test\addons\*.h test\addons-napi\*.cc test\addons-napi\*.h test\cctest\*.cc test\cctest\*.h tools\icu\*.cc tools\icu\*.h
565552
python tools/check-imports.py
566553
goto lint-js
567554

@@ -673,7 +660,7 @@ del .used_configure_flags
673660
goto exit
674661

675662
:help
676-
echo vcbuild.bat [debug/release] [msi] [doc] [test/test-ci/test-all/test-addons/test-addons-napi/test-internet/test-pummel/test-simple/test-message/test-gc/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [noperfctr] [ltcg] [nopch] [licensetf] [sign] [ia32/x86/x64] [vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [no-cctest] [openssl-no-asm]
663+
echo vcbuild.bat [debug/release] [msi] [doc] [test/test-ci/test-all/test-addons/test-addons-napi/test-internet/test-pummel/test-simple/test-message/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [noperfctr] [ltcg] [nopch] [licensetf] [sign] [ia32/x86/x64] [vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [no-cctest] [openssl-no-asm]
677664
echo Examples:
678665
echo vcbuild.bat : builds release build
679666
echo vcbuild.bat debug : builds debug build

0 commit comments

Comments
 (0)