Skip to content

Commit

Permalink
test: split test in parallel/sequential
Browse files Browse the repository at this point in the history
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: #172
Fix: #139
  • Loading branch information
indutny committed Dec 17, 2014
1 parent 165b70f commit 0e19476
Show file tree
Hide file tree
Showing 775 changed files with 41 additions and 78 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,18 @@ distclean:
-rm -rf node_modules

test: all
$(PYTHON) tools/test.py --mode=release simple message
$(PYTHON) tools/test.py --mode=release message parallel sequential
$(MAKE) jslint
$(MAKE) cpplint

test-parallel: all
$(PYTHON) tools/test.py --mode=release parallel -J

test-http1: all
$(PYTHON) tools/test.py --mode=release --use-http1 simple message
$(PYTHON) tools/test.py --mode=release --use-http1 sequential parallel message

test-valgrind: all
$(PYTHON) tools/test.py --mode=release --valgrind simple message
$(PYTHON) tools/test.py --mode=release --valgrind sequential parallel message

test/gc/node_modules/weak/build/Release/weakref.node:
@if [ ! -f $(NODE_EXE) ]; then make all; fi
Expand Down Expand Up @@ -141,7 +144,7 @@ test-message: test-build
$(PYTHON) tools/test.py message

test-simple: all
$(PYTHON) tools/test.py simple
$(PYTHON) tools/test.py parallel sequential

test-pummel: all wrk
$(PYTHON) tools/test.py pummel
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
var assert = require('assert');
var net = require('net');
var util = require('util');
var common = require('../common');
var revivals = 0;
var deaths = 0;

Expand Down Expand Up @@ -49,7 +50,7 @@ function tryTimer() {
function tryListen() {
console.log('create a server');
net.createServer()
.listen(0)
.listen(common.PORT)
.on('listening', function() {
revivals++;
this.close();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ child.exec(nodejs + ' --eval "require(\'' + filename + '\')"',
});

// module path resolve bug, regression test
child.exec(nodejs + ' --eval "require(\'./test/simple/test-cli-eval.js\')"',
child.exec(nodejs + ' --eval "require(\'./test/parallel/test-cli-eval.js\')"',
function(status, stdout, stderr) {
assert.equal(status.code, 42);
});
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
var assert = require('assert');
var cluster = require('cluster')
var net = require('net');
var common = require('../common');

var destroyed;
var success;
Expand Down Expand Up @@ -53,7 +54,7 @@ if (cluster.isMaster) {
success = true;
});

}).listen(0, function() {
}).listen(common.PORT, function() {
var port = this.address().port;

worker = cluster.fork()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var assert = require('assert');

var fs = require('fs'),
dgram = require('dgram'), server, client,
server_port = 20989,
server_port = common.PORT,
message_to_send = 'A message to send',
timer;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function test_simple_relative_symlink(callback) {
var entry = common.tmpDir + '/symlink',
expected = common.tmpDir + '/cycles/root.js';
[
[entry, '../tmp/cycles/root.js']
[entry, '../' + common.tmpDirName + '/cycles/root.js']
].forEach(function(t) {
try {fs.unlinkSync(t[0]);}catch (e) {}
console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file');
Expand Down Expand Up @@ -335,15 +335,16 @@ function test_deep_symlink_mix(callback) {
fs.mkdirSync(tmp('node-test-realpath-d2'), 0700);
try {
[
[entry, '../tmp/node-test-realpath-d1/foo'],
[tmp('node-test-realpath-d1'), '../tmp/node-test-realpath-d2'],
[entry, '../' + common.tmpDirName + '/node-test-realpath-d1/foo'],
[tmp('node-test-realpath-d1'),
'../' + common.tmpDirName + '/node-test-realpath-d2'],
[tmp('node-test-realpath-d2/foo'), '../node-test-realpath-f2'],
[tmp('node-test-realpath-f2'), fixturesAbsDir +
'/nested-index/one/realpath-c'],
[fixturesAbsDir + '/nested-index/one/realpath-c', fixturesAbsDir +
'/nested-index/two/realpath-c'],
[fixturesAbsDir + '/nested-index/two/realpath-c',
'../../../tmp/cycles/root.js']
'../../../' + common.tmpDirName + '/cycles/root.js']
].forEach(function(t) {
//common.debug('setting up '+t[0]+' -> '+t[1]);
try { fs.unlinkSync(t[0]); } catch (e) {}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

var assert = require('assert'),
common = require('../common'),
http = require('http');

var complete;
Expand All @@ -38,7 +39,7 @@ var server = http.createServer(function (req, res) {
});


server.listen(0, function () {
server.listen(common.PORT, function () {
console.log('listen', server.address().port);

var agent = new http.Agent({maxSockets: 1});
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ process.on('exit', function() {
var server = http.createServer(function(req, res) {
request++;
res.end();
}).listen(function() {
}).listen(common.PORT, function() {
var options = {
agent: null,
port: this.address().port
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0e19476

Please sign in to comment.