Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

change test ports, dont use 3xxx range

I use a lot of these for local VM stuff etc so it
is sorta annoying to shut the VM down to run these tests
  • Loading branch information...
commit ddfe65868af29ae8ce931c40ecd00cbc3c61a219 1 parent 8b4fb27
@tj authored
Showing with 80 additions and 84 deletions.
  1. +0 −4 benchmark/sub.js
  2. +2 −2 test/test.emitter.js
  3. +7 −7 test/test.emitter.many-connect.js
  4. +7 −7 test/test.emitter.many.js
  5. +2 −2 test/test.emitter.wildcards.js
  6. +2 −2 test/test.pubsub.js
  7. +4 −4 test/test.pubsub.multiple-subscribers.js
  8. +2 −2 test/test.pubsub.string-subscriptions.js
  9. +2 −2 test/test.pubsub.subscriptions.js
  10. +2 −2 test/test.pushpull.js
  11. +2 −2 test/test.pushpull.json.js
  12. +6 −6 test/test.pushpull.multiple-pushers.js
  13. +2 −2 test/test.pushpull.pull-bind.js
  14. +4 −4 test/test.reqrep.chain.js
  15. +2 −2 test/test.reqrep.js
  16. +2 −2 test/test.reqrep.json.js
  17. +2 −2 test/test.reqrep.ordering.js
  18. +2 −2 test/test.reqrep.undefined.js
  19. +2 −2 test/test.reqrep.vargs.js
  20. +2 −2 test/test.socket.accept.econnrefused.js
  21. +2 −2 test/test.socket.accept.econnreset.js
  22. +2 −2 test/test.socket.accept.epipe.js
  23. +2 −2 test/test.socket.connect.econnrefused.js
  24. +2 −2 test/test.socket.connect.econnreset.js
  25. +2 −2 test/test.socket.connect.epipe.js
  26. +2 −2 test/test.socket.connect.error.js
  27. +6 −6 test/test.socket.error-remove-sock.js
  28. +3 −3 test/test.socket.rebind.js
  29. +3 −3 test/test.socket.reconnect.js
View
4 benchmark/sub.js
@@ -44,10 +44,6 @@ function min(arr) {
});
}
-function mean(arr) {
- return sum(arr) / arr.length | 0;
-}
-
function median(arr) {
arr = arr.sort();
return arr[arr.length / 2 | 0];
View
4 test/test.emitter.js
@@ -7,8 +7,8 @@ var pub = ss.socket('pub-emitter')
// test basic 1-1 pub/sub emitter style
-pub.bind(3000, function(){
- sub.connect(3000, function(){
+pub.bind(4444, function(){
+ sub.connect(4444, function(){
sub.on('foo', function(){
arguments.length.should.equal(0);
});
View
14 test/test.emitter.many-connect.js
@@ -10,17 +10,17 @@ var worker = ss.socket('pub-emitter')
/*
+--> a
- worker ---|--> b
+ worker ---|--> b
+--> c
*/
-worker.connect(3000);
-worker.connect(3001);
-worker.connect(3002);
-a.bind(3000);
-b.bind(3001);
-c.bind(3002);
+worker.connect(4444);
+worker.connect(4445);
+worker.connect(4446);
+a.bind(4444);
+b.bind(4445);
+c.bind(4446);
var vals = [];
var pending = 3;
View
14 test/test.emitter.many.js
@@ -12,17 +12,17 @@ var worker = ss.socket('pub-emitter')
/*
<--- a
- worker ---> relay <--- b
+ worker ---> relay <--- b
<--- c
*/
-relaySub.bind(3000);
-relayPub.bind(4000);
-worker.connect(3000);
-a.connect(4000);
-b.connect(4000);
-c.connect(4000);
+relaySub.bind(4444);
+relayPub.bind(5555);
+worker.connect(4444);
+a.connect(5555);
+b.connect(5555);
+c.connect(5555);
relaySub.on('progress', function(id, n){
relayPub.emit('progress', id, n);
View
4 test/test.emitter.wildcards.js
@@ -5,7 +5,7 @@ var axon = require('..')
, sub = axon.socket('sub-emitter')
, pending = 8
-pub.bind(3000);
+pub.bind(4444);
sub.on('user:login', function(name){
assert('tobi' == name);
@@ -41,7 +41,7 @@ sub.on('foo.bar.baz', function(){
--pending || done();
});
-sub.connect(3000, function(){
+sub.connect(4444, function(){
pub.emit('user:login', 'tobi');
pub.emit('user:logout', 'tobi');
pub.emit('weird[chars]{some stuff}', 'hello');
View
4 test/test.pubsub.js
@@ -10,8 +10,8 @@ var n = 0
// test basic 1-1 pub/sub
-pub.bind(3000, function(){
- sub.connect(3000, function(){
+pub.bind(4444, function(){
+ sub.connect(4444, function(){
sub.on('message', function(msg){
msg.should.be.an.instanceof(Buffer);
msg.should.have.length(3);
View
8 test/test.pubsub.multiple-subscribers.js
@@ -17,10 +17,10 @@ var messages = {
// test basic 1-M pub/sub
-pub.bind(3000, function(){
- a.connect(3000, function(){
- b.connect(3000, function(){
- c.connect(3000, function(){
+pub.bind(4444, function(){
+ a.connect(4444, function(){
+ b.connect(4444, function(){
+ c.connect(4444, function(){
setTimeout(function(){
pub.send('foo');
pub.send('bar');
View
4 test/test.pubsub.string-subscriptions.js
@@ -4,12 +4,12 @@ var axon = require('..')
, pub = axon.socket('pub')
, sub = axon.socket('sub')
-pub.bind(3000);
+pub.bind(4444);
sub.subscribe('user:*');
sub.subscribe('page:view');
-sub.connect(3000, function(){
+sub.connect(4444, function(){
pub.send('user:login', 'tobi');
pub.send('user:login', 'loki');
pub.send('user:logout', 'jane');
View
4 test/test.pubsub.subscriptions.js
@@ -4,12 +4,12 @@ var axon = require('..')
, pub = axon.socket('pub')
, sub = axon.socket('sub')
-pub.bind(3000);
+pub.bind(4444);
sub.subscribe(/^user:*/);
sub.subscribe(/^page:view/);
-sub.connect(3000, function(){
+sub.connect(4444, function(){
pub.send('user:login', 'tobi');
pub.send('user:login', 'loki');
pub.send('user:logout', 'jane');
View
4 test/test.pushpull.js
@@ -10,11 +10,11 @@ var push = ss.socket('push')
var n = 0
, closed;
-push.bind(3000);
+push.bind(4444);
push.send('foo');
push.send('bar');
-pull.connect(3000);
+pull.connect(4444);
pull.on('message', function(msg){
msg.should.be.an.instanceof(Buffer);
msg.should.have.length(3);
View
4 test/test.pushpull.json.js
@@ -9,7 +9,7 @@ var push = ss.socket('push')
var n = 0;
-push.bind(3000);
+push.bind(4444);
push.format('json');
push.send({ path: '/tmp/foo.png' });
@@ -18,7 +18,7 @@ push.send({ path: '/tmp/baz.png' });
var strs = ['foo', 'bar', 'baz'];
-pull.connect(3000);
+pull.connect(4444);
pull.on('message', function(msg){
msg.should.have.property('path', '/tmp/' + strs[n++] + '.png');
if (n == 3) {
View
12 test/test.pushpull.multiple-pushers.js
@@ -8,9 +8,9 @@ var pusher1 = ss.socket('push');
var pusher2 = ss.socket('push');
var pusher3 = ss.socket('push');
-pusher1.bind(3000);
-pusher2.bind(3001);
-pusher3.bind(3002);
+pusher1.bind(4444);
+pusher2.bind(4445);
+pusher3.bind(4446);
pusher1.send('hey');
pusher2.send('hey');
@@ -20,9 +20,9 @@ pusher3.send('hey');
var pull = ss.socket('pull');
-pull.connect(3000);
-pull.connect(3001);
-pull.connect(3002);
+pull.connect(4444);
+pull.connect(4445);
+pull.connect(4446);
var msgs = [];
View
4 test/test.pushpull.pull-bind.js
@@ -10,8 +10,8 @@ var push = ss.socket('push')
var n = 0
, closed;
-pull.bind(3000);
-push.connect(3000);
+pull.bind(4444);
+push.connect(4444);
push.send('foo');
push.send('bar');
View
8 test/test.reqrep.chain.js
@@ -7,11 +7,11 @@ var req = axon.socket('req')
, req2 = axon.socket('req')
, rep2 = axon.socket('rep');
-req.bind(3000);
-rep.connect(3000);
+req.bind(4444);
+rep.connect(4444);
-req2.bind(3001);
-rep2.connect(3001);
+req2.bind(4445);
+rep2.connect(4445);
rep.on('message', function(msg, reply){
req2.send(msg, function(msg){
View
4 test/test.reqrep.js
@@ -5,8 +5,8 @@ var axon = require('..')
var req = axon.socket('req')
, rep = axon.socket('rep');
-req.bind(3000);
-rep.connect(3000);
+req.bind(4444);
+rep.connect(4444);
rep.on('message', function(msg, reply){
reply('got "' + msg + '"');
View
4 test/test.reqrep.json.js
@@ -7,8 +7,8 @@ var axon = require('..')
req.format('json');
rep.format('json');
-req.bind(3000);
-rep.connect(3000);
+req.bind(4444);
+rep.connect(4444);
rep.on('message', function(obj, reply){
reply({ name: obj.name });
View
4 test/test.reqrep.ordering.js
@@ -5,8 +5,8 @@ var axon = require('..')
var req = axon.socket('req')
, rep = axon.socket('rep');
-req.bind(3000);
-rep.connect(3000);
+req.bind(4444);
+rep.connect(4444);
var pending = 10
, n = pending
View
4 test/test.reqrep.undefined.js
@@ -8,8 +8,8 @@ var axon = require('..')
req.format('json');
rep.format('json');
-req.bind(3000);
-rep.connect(3000);
+req.bind(4444);
+rep.connect(4444);
rep.on('message', function(obj, reply){
reply(undefined);
View
4 test/test.reqrep.vargs.js
@@ -5,8 +5,8 @@ var axon = require('..')
var req = axon.socket('req')
, rep = axon.socket('rep');
-req.bind(3000);
-rep.connect(3000);
+req.bind(4444);
+rep.connect(4444);
rep.on('message', function(first, last, reply){
reply(first + ' ' + last)
View
4 test/test.socket.accept.econnrefused.js
@@ -5,8 +5,8 @@ var axon = require('..')
var push = axon.socket('push')
, pull = axon.socket('pull');
-push.bind(3000);
-pull.connect(3000);
+push.bind(4444);
+pull.connect(4444);
push.on('ignored error', function(err){
assert('ECONNREFUSED' == err.code);
View
4 test/test.socket.accept.econnreset.js
@@ -5,8 +5,8 @@ var axon = require('..')
var push = axon.socket('push')
, pull = axon.socket('pull');
-push.bind(3000);
-pull.connect(3000);
+push.bind(4444);
+pull.connect(4444);
push.on('ignored error', function(err){
assert('ECONNRESET' == err.code);
View
4 test/test.socket.accept.epipe.js
@@ -5,8 +5,8 @@ var axon = require('..')
var push = axon.socket('push')
, pull = axon.socket('pull');
-push.bind(3000);
-pull.connect(3000);
+push.bind(4444);
+pull.connect(4444);
push.on('ignored error', function(err){
assert('EPIPE' == err.code);
View
4 test/test.socket.connect.econnrefused.js
@@ -5,8 +5,8 @@ var axon = require('..')
var push = axon.socket('push')
, pull = axon.socket('pull');
-pull.bind(3000);
-push.connect(3000);
+pull.bind(4444);
+push.connect(4444);
push.on('ignored error', function(err){
assert('ECONNREFUSED' == err.code);
View
4 test/test.socket.connect.econnreset.js
@@ -5,8 +5,8 @@ var axon = require('..')
var push = axon.socket('push')
, pull = axon.socket('pull');
-pull.bind(3000);
-push.connect(3000);
+pull.bind(4444);
+push.connect(4444);
push.on('ignored error', function(err){
assert('ECONNRESET' == err.code);
View
4 test/test.socket.connect.epipe.js
@@ -5,8 +5,8 @@ var axon = require('..')
var push = axon.socket('push')
, pull = axon.socket('pull');
-pull.bind(3000);
-push.connect(3000);
+pull.bind(4444);
+push.connect(4444);
push.on('ignored error', function(err){
assert('EPIPE' == err.code);
View
4 test/test.socket.connect.error.js
@@ -5,8 +5,8 @@ var axon = require('..')
var push = axon.socket('push')
, pull = axon.socket('pull');
-pull.bind(3000);
-push.connect(3000);
+pull.bind(4444);
+push.connect(4444);
push.on('error', function(err){
assert('boom' == err.message);
View
12 test/test.socket.error-remove-sock.js
@@ -7,13 +7,13 @@ var a = axon.socket('push')
, c = axon.socket('push')
, pull = axon.socket('pull');
-a.bind(3001);
-b.bind(3002);
-c.bind(3003);
+a.bind(4441);
+b.bind(4442);
+c.bind(4443);
-pull.connect(3001);
-pull.connect(3002);
-pull.connect(3003);
+pull.connect(4441);
+pull.connect(4442);
+pull.connect(4443);
pull.once('error', function(err){
assert('boom' == err.message);
View
6 test/test.socket.rebind.js
@@ -11,8 +11,8 @@ var push = ss.socket('push')
var msgs = []
, n = 0;
-push.bind(3000);
-pull.connect(3000);
+push.bind(4444);
+pull.connect(4444);
var id = setInterval(function(){
push.send(String(n++));
@@ -26,7 +26,7 @@ pull.on('message', function(msg){
push.close();
push.once('close', function(){
setTimeout(function(){
- push.bind(3000);
+ push.bind(4444);
}, 50);
});
break;
View
6 test/test.socket.reconnect.js
@@ -11,8 +11,8 @@ var push = ss.socket('push')
var msgs = []
, n = 0;
-push.bind(3000);
-pull.connect(3000);
+push.bind(4444);
+pull.connect(4444);
var id = setInterval(function(){
push.send(String(n++));
@@ -26,7 +26,7 @@ pull.on('message', function(msg){
pull.close();
pull.once('close', function(){
setTimeout(function(){
- pull.connect(3000);
+ pull.connect(4444);
}, 50);
});
break;
Please sign in to comment.
Something went wrong with that request. Please try again.