Skip to content

Commit

Permalink
test: remove test/gc, integrate into parallel
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
addaleax authored and targos committed Aug 1, 2018
1 parent 29bc553 commit 0beffc0
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 152 deletions.
20 changes: 1 addition & 19 deletions Makefile
Expand Up @@ -314,15 +314,6 @@ benchmark/napi/function_args/build/Release/binding.node: all \
--directory="$(shell pwd)/benchmark/napi/function_args" \
--nodedir="$(shell pwd)"

# Implicitly depends on $(NODE_EXE). We don't depend on it explicitly because
# it always triggers a rebuild due to it being a .PHONY rule. See the comment
# near the build-addons rule for more background.
test/gc/build/Release/binding.node: test/gc/binding.cc test/gc/binding.gyp
$(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
--python="$(PYTHON)" \
--directory="$(shell pwd)/test/gc" \
--nodedir="$(shell pwd)"

DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.js doc/api/addons.md

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

.PHONY: test-gc
test-gc: all test/gc/build/Release/binding.node
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) gc

.PHONY: test-gc-clean
test-gc-clean:
$(RM) -r test/gc/build

test-build: | all build-addons build-addons-napi

test-build-addons-napi: all build-addons-napi

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

test-all-valgrind: test-build
Expand Down Expand Up @@ -1185,7 +1168,6 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
test/cctest/*.h \
test/addons-napi/*/*.cc \
test/addons-napi/*/*.h \
test/gc/binding.cc \
tools/icu/*.cc \
tools/icu/*.h \
))
Expand Down
1 change: 0 additions & 1 deletion test/README.md
Expand Up @@ -21,7 +21,6 @@ GitHub with the `autocrlf` git config flag set to true.
|common | |Common modules shared among many tests. [Documentation](./common/README.md)|
|es-module |Yes |Test ESM module loading.|
|fixtures | |Test fixtures used in various tests throughout the test suite.|
|gc |No |Tests for garbage collection related functionality.|
|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.|
|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`.|
|message |Yes |Tests for messages that are output for various conditions (```console.log```, error messages etc.)|
Expand Down
1 change: 0 additions & 1 deletion test/gc/.gitignore

This file was deleted.

80 changes: 0 additions & 80 deletions test/gc/binding.cc

This file was deleted.

9 changes: 0 additions & 9 deletions test/gc/binding.gyp

This file was deleted.

6 changes: 0 additions & 6 deletions test/gc/testcfg.py

This file was deleted.

@@ -1,5 +1,6 @@
'use strict';
// just like test/gc/http-client.js,
// Flags: --expose-gc
// just like test-gc-http-client.js,
// but aborting every connection that comes in.

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

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

count++;
weak(req, afterGC);
common.onGC(req, { ongc });
})();

setImmediate(getall);
Expand All @@ -45,7 +45,7 @@ function getall() {
for (let i = 0; i < 10; i++)
getall();

function afterGC() {
function ongc() {
countGC++;
}

Expand Down
@@ -1,5 +1,6 @@
'use strict';
// just like test/gc/http-client.js,
// Flags: --expose-gc
// just like test-gc-http-client.js,
// but with an on('error') handler that does nothing.

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

const http = require('http');
const weak = require(`./build/${common.buildType}/binding`);
const todo = 500;
let done = 0;
let count = 0;
Expand Down Expand Up @@ -42,7 +42,7 @@ function getall() {
}, cb).on('error', onerror);

count++;
weak(req, afterGC);
common.onGC(req, { ongc });
})();

setImmediate(getall);
Expand All @@ -53,7 +53,7 @@ function runTest() {
getall();
}

function afterGC() {
function ongc() {
countGC++;
}

Expand Down
@@ -1,5 +1,6 @@
'use strict';
// just like test/gc/http-client.js,
// Flags: --expose-gc
// just like test-gc-http-client.js,
// but with a timeout set

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

const http = require('http');
const weak = require(`./build/${common.buildType}/binding`);
const todo = 550;
let done = 0;
let count = 0;
Expand Down Expand Up @@ -45,7 +45,7 @@ function getall() {
});

count++;
weak(req, afterGC);
common.onGC(req, { ongc });
})();

setImmediate(getall);
Expand All @@ -54,7 +54,7 @@ function getall() {
for (let i = 0; i < 10; i++)
getall();

function afterGC() {
function ongc() {
countGC++;
}

Expand Down
@@ -1,4 +1,5 @@
'use strict';
// Flags: --expose-gc
// just a simple http server and client.

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

const http = require('http');
const weak = require(`./build/${common.buildType}/binding`);
const todo = 500;
let done = 0;
let count = 0;
Expand Down Expand Up @@ -40,7 +40,7 @@ function getall() {
}, cb);

count++;
weak(req, afterGC);
common.onGC(req, { ongc });
})();

setImmediate(getall);
Expand All @@ -49,7 +49,7 @@ function getall() {
for (let i = 0; i < 10; i++)
getall();

function afterGC() {
function ongc() {
countGC++;
}

Expand Down
@@ -1,5 +1,6 @@
'use strict';
// just like test/gc/http-client-timeout.js,
// Flags: --expose-gc
// just like test-gc-http-client-timeout.js,
// but using a net server/client instead

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

const net = require('net');
const weak = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
const todo = 500;
let done = 0;
Expand All @@ -44,15 +44,15 @@ function getall() {
});

count++;
weak(req, afterGC);
common.onGC(req, { ongc });

setImmediate(getall);
}

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

function afterGC() {
function ongc() {
countGC++;
}

Expand Down
1 change: 0 additions & 1 deletion tools/test.py
Expand Up @@ -1538,7 +1538,6 @@ def PrintCrashed(code):
'addons-napi',
'code-cache',
'doctool',
'gc',
'internet',
'pummel',
'test-known-issues',
Expand Down
19 changes: 3 additions & 16 deletions vcbuild.bat
Expand Up @@ -33,7 +33,6 @@ set lint_js=
set lint_cpp=
set lint_md=
set lint_md_build=
set build_testgc_addon=
set noetw=
set noetw_msi_arg=
set noperfctr=
Expand Down Expand Up @@ -88,13 +87,12 @@ if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&
if /i "%1"=="test-addons-napi" set test_args=%test_args% addons-napi&set build_addons_napi=1&goto arg-ok
if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok
if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok
if /i "%1"=="test-gc" set test_args=%test_args% gc&set build_testgc_addon=1&goto arg-ok
if /i "%1"=="test-tick-processor" set test_args=%test_args% tick-processor&goto arg-ok
if /i "%1"=="test-internet" set test_args=%test_args% internet&goto arg-ok
if /i "%1"=="test-pummel" set test_args=%test_args% pummel&goto arg-ok
if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues&goto arg-ok
if /i "%1"=="test-async-hooks" set test_args=%test_args% async-hooks&goto arg-ok
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
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
if /i "%1"=="test-node-inspect" set test_node_inspect=1&goto arg-ok
if /i "%1"=="test-check-deopts" set test_check_deopts=1&goto arg-ok
if /i "%1"=="test-npm" set test_npm=1&goto arg-ok
Expand Down Expand Up @@ -468,17 +466,6 @@ for %%F in (%config%\doc\api\*.md) do (
:run
@rem Run tests if requested.

@rem Build test/gc add-on if required.
if "%build_testgc_addon%"=="" goto build-addons
%node_gyp_exe% rebuild --directory="%~dp0test\gc" --nodedir="%~dp0."
if errorlevel 1 goto build-testgc-addon-failed
goto build-addons

:build-testgc-addon-failed
echo Failed to build test/gc add-on."
goto exit

:build-addons
if not defined build_addons goto build-addons-napi
if not exist "%node_exe%" (
echo Failed to find node.exe
Expand Down Expand Up @@ -561,7 +548,7 @@ goto lint-cpp

:lint-cpp
if not defined lint_cpp goto lint-js
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
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
python tools/check-imports.py
goto lint-js

Expand Down Expand Up @@ -673,7 +660,7 @@ del .used_configure_flags
goto exit

:help
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]
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]
echo Examples:
echo vcbuild.bat : builds release build
echo vcbuild.bat debug : builds debug build
Expand Down

0 comments on commit 0beffc0

Please sign in to comment.