Skip to content
Browse files

removing resubscribe delay test also due to synthetic emits

  • Loading branch information...
1 parent 52c73bc commit 3339602eef11e738eac7a9a345e2804c3560bf71 @substack committed Jul 19, 2012
Showing with 0 additions and 45 deletions.
  1. +0 −45 test/resubscribe_delay.js
View
45 test/resubscribe_delay.js
@@ -1,45 +0,0 @@
-var seaport = require('../');
-var test = require('tap').test;
-
-test('resubscribe with delayed subscription', function(t) {
- var serverPort = Math.floor(Math.random() * 5e4 + 1e4);
- var server = seaport.createServer();
- var client = seaport.connect('localhost:' + serverPort, {reconnect: 10});
-
- t.plan(6);
-
- var eventNames = ['allocate', 'assume', 'free'];
-
- setTimeout(function () {
- eventNames.forEach(function(eventName) {
- client.subscribe(eventName, function() {
- t.ok(true, eventName + ' emitted');
- });
- });
- }, 100);
-
- function emit() {
- eventNames.forEach(function(eventName) {
- server.emit(eventName, {});
- });
- }
-
- server.listen(serverPort);
-
- // Wait for client to connect
- setTimeout(emit, 200)
-
- // Wait for first tests to finish
- setTimeout(function() {
- client.up.conn.stream.end();
- }, 400);
-
- // Run second test
- setTimeout(emit, 1600);
-
- t.on('end', function() {
- server.close();
- client.close();
- t.ok(true, 'closed server');
- });
-});

0 comments on commit 3339602

Please sign in to comment.
Something went wrong with that request. Please try again.