Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-07-27 14:36:35 +0300
committerAnna Henningsen <anna@addaleax.net>2018-08-01 19:04:56 +0300
commit02badc424f92f71de66adf945e51fd07a914aaf1 (patch)
tree6747db01dcc4b6ce932b0af9268024bca6857e61
parentdcfbedb36518b1ca505149e135dc3ffc4d9ed2d5 (diff)
test: remove test/gc, integrate into parallel
There’s no reason to have a separate addon just for testing GC anymore. PR-URL: https://github.com/nodejs/node/pull/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>
-rw-r--r--Makefile20
-rw-r--r--test/README.md1
-rw-r--r--test/gc/.gitignore1
-rw-r--r--test/gc/binding.cc80
-rw-r--r--test/gc/binding.gyp9
-rw-r--r--test/gc/testcfg.py6
-rw-r--r--test/parallel/test-gc-http-client-connaborted.js (renamed from test/gc/test-http-client-connaborted.js)8
-rw-r--r--test/parallel/test-gc-http-client-onerror.js (renamed from test/gc/test-http-client-onerror.js)8
-rw-r--r--test/parallel/test-gc-http-client-timeout.js (renamed from test/gc/test-http-client-timeout.js)8
-rw-r--r--test/parallel/test-gc-http-client.js (renamed from test/gc/test-http-client.js)6
-rw-r--r--test/parallel/test-gc-net-timeout.js (renamed from test/gc/test-net-timeout.js)8
-rwxr-xr-xtools/test.py1
-rw-r--r--vcbuild.bat19
13 files changed, 23 insertions, 152 deletions
diff --git a/Makefile b/Makefile
index c3da8e88bff..b228cbbf7a0 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
@@ -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
@@ -1178,7 +1161,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 \
))
diff --git a/test/README.md b/test/README.md
index ad08f074aa4..582e5c58367 100644
--- a/test/README.md
+++ b/test/README.md
@@ -25,7 +25,6 @@ GitHub with the `autocrlf` git config flag set to true.
|doctool |Yes |Tests for the documentation generator.|
|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.)|
diff --git a/test/gc/.gitignore b/test/gc/.gitignore
deleted file mode 100644
index 567609b1234..00000000000
--- a/test/gc/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-build/
diff --git a/test/gc/binding.cc b/test/gc/binding.cc
deleted file mode 100644
index 8bde3b8505c..00000000000
--- a/test/gc/binding.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "node.h"
-#include "uv.h"
-
-#include <assert.h>
-#include <stdlib.h>
-
-#include <vector>
-
-#ifdef NDEBUG
-#define CHECK(x) do { if (!(x)) abort(); } while (false)
-#else
-#define CHECK assert
-#endif
-
-#define CHECK_EQ(a, b) CHECK((a) == (b))
-
-namespace {
-
-struct Callback {
- inline Callback(v8::Isolate* isolate,
- v8::Local<v8::Object> object,
- v8::Local<v8::Function> function)
- : object(isolate, object), function(isolate, function) {}
-
- v8::Persistent<v8::Object> object;
- v8::Persistent<v8::Function> function;
-};
-
-static uv_async_t async_handle;
-static std::vector<Callback*> callbacks;
-
-inline void Prime() {
- uv_ref(reinterpret_cast<uv_handle_t*>(&async_handle));
- CHECK_EQ(0, uv_async_send(&async_handle));
-}
-
-inline void AsyncCallback(uv_async_t*) {
- auto isolate = v8::Isolate::GetCurrent();
- v8::HandleScope handle_scope(isolate);
- auto context = isolate->GetCurrentContext();
- auto global = context->Global();
- while (!callbacks.empty()) {
- v8::HandleScope handle_scope(isolate);
- auto callback = callbacks.back();
- callbacks.pop_back();
- auto function = v8::Local<v8::Function>::New(isolate, callback->function);
- delete callback;
- if (node::MakeCallback(isolate, global, function, 0, nullptr).IsEmpty())
- return Prime(); // Have exception, flush remainder on next loop tick.
- }
- uv_unref(reinterpret_cast<uv_handle_t*>(&async_handle));
-}
-
-inline void OnGC(const v8::FunctionCallbackInfo<v8::Value>& info) {
- CHECK(info[0]->IsObject());
- CHECK(info[1]->IsFunction());
- auto object = info[0].As<v8::Object>();
- auto function = info[1].As<v8::Function>();
- auto callback = new Callback(info.GetIsolate(), object, function);
- auto on_callback = [] (const v8::WeakCallbackInfo<Callback>& data) {
- auto callback = data.GetParameter();
- callbacks.push_back(callback);
- callback->object.Reset();
- Prime();
- };
- callback->object.SetWeak(callback, on_callback,
- v8::WeakCallbackType::kParameter);
-}
-
-inline void Initialize(v8::Local<v8::Object> exports,
- v8::Local<v8::Value> module,
- v8::Local<v8::Context> context) {
- NODE_SET_METHOD(module->ToObject(context).ToLocalChecked(), "exports", OnGC);
- CHECK_EQ(0, uv_async_init(uv_default_loop(), &async_handle, AsyncCallback));
- uv_unref(reinterpret_cast<uv_handle_t*>(&async_handle));
-}
-
-} // anonymous namespace
-
-NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, Initialize)
diff --git a/test/gc/binding.gyp b/test/gc/binding.gyp
deleted file mode 100644
index dc896336017..00000000000
--- a/test/gc/binding.gyp
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- 'targets': [
- {
- 'target_name': 'binding',
- 'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
- 'sources': [ 'binding.cc' ],
- },
- ],
-}
diff --git a/test/gc/testcfg.py b/test/gc/testcfg.py
deleted file mode 100644
index d6bbcd60fff..00000000000
--- a/test/gc/testcfg.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import sys, os
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-import testpy
-
-def GetConfiguration(context, root):
- return testpy.SimpleTestConfiguration(context, root, 'gc', ['--expose-gc'])
diff --git a/test/gc/test-http-client-connaborted.js b/test/parallel/test-gc-http-client-connaborted.js
index 008d75bca5d..3218c054ed4 100644
--- a/test/gc/test-http-client-connaborted.js
+++ b/test/parallel/test-gc-http-client-connaborted.js
@@ -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');
@@ -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;
@@ -36,7 +36,7 @@ function getall() {
}, cb).on('error', cb);
count++;
- weak(req, afterGC);
+ common.onGC(req, { ongc });
})();
setImmediate(getall);
@@ -45,7 +45,7 @@ function getall() {
for (let i = 0; i < 10; i++)
getall();
-function afterGC() {
+function ongc() {
countGC++;
}
diff --git a/test/gc/test-http-client-onerror.js b/test/parallel/test-gc-http-client-onerror.js
index 8b05e941749..8842da93c30 100644
--- a/test/gc/test-http-client-onerror.js
+++ b/test/parallel/test-gc-http-client-onerror.js
@@ -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');
@@ -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;
@@ -42,7 +42,7 @@ function getall() {
}, cb).on('error', onerror);
count++;
- weak(req, afterGC);
+ common.onGC(req, { ongc });
})();
setImmediate(getall);
@@ -53,7 +53,7 @@ function runTest() {
getall();
}
-function afterGC() {
+function ongc() {
countGC++;
}
diff --git a/test/gc/test-http-client-timeout.js b/test/parallel/test-gc-http-client-timeout.js
index c396a89032b..e6878021ef9 100644
--- a/test/gc/test-http-client-timeout.js
+++ b/test/parallel/test-gc-http-client-timeout.js
@@ -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');
@@ -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;
@@ -45,7 +45,7 @@ function getall() {
});
count++;
- weak(req, afterGC);
+ common.onGC(req, { ongc });
})();
setImmediate(getall);
@@ -54,7 +54,7 @@ function getall() {
for (let i = 0; i < 10; i++)
getall();
-function afterGC() {
+function ongc() {
countGC++;
}
diff --git a/test/gc/test-http-client.js b/test/parallel/test-gc-http-client.js
index 8b50ad5ea4f..d31874fa166 100644
--- a/test/gc/test-http-client.js
+++ b/test/parallel/test-gc-http-client.js
@@ -1,4 +1,5 @@
'use strict';
+// Flags: --expose-gc
// just a simple http server and client.
const common = require('../common');
@@ -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;
@@ -40,7 +40,7 @@ function getall() {
}, cb);
count++;
- weak(req, afterGC);
+ common.onGC(req, { ongc });
})();
setImmediate(getall);
@@ -49,7 +49,7 @@ function getall() {
for (let i = 0; i < 10; i++)
getall();
-function afterGC() {
+function ongc() {
countGC++;
}
diff --git a/test/gc/test-net-timeout.js b/test/parallel/test-gc-net-timeout.js
index 05d854d18ee..236980efa3d 100644
--- a/test/gc/test-net-timeout.js
+++ b/test/parallel/test-gc-net-timeout.js
@@ -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');
@@ -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;
@@ -44,7 +44,7 @@ function getall() {
});
count++;
- weak(req, afterGC);
+ common.onGC(req, { ongc });
setImmediate(getall);
}
@@ -52,7 +52,7 @@ function getall() {
for (let i = 0; i < 10; i++)
getall();
-function afterGC() {
+function ongc() {
countGC++;
}
diff --git a/tools/test.py b/tools/test.py
index bd3a9e347e2..b6f91aa1ebd 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -1538,7 +1538,6 @@ IGNORED_SUITES = [
'addons-napi',
'code-cache',
'doctool',
- 'gc',
'internet',
'pummel',
'tick-processor',
diff --git a/vcbuild.bat b/vcbuild.bat
index e8b02057fe5..e2f6cfe180c 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -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=
@@ -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
@@ -467,17 +465,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
@@ -560,7 +547,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
@@ -672,7 +659,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