@@ -10,8 +10,7 @@ describe('socket.monitor', function() {
1010
1111 it ( 'should be able to monitor the socket' , function ( done ) {
1212 var rep = zmq . socket ( 'rep' )
13- , req = zmq . socket ( 'req' )
14- , events = [ ] ;
13+ , req = zmq . socket ( 'req' ) ;
1514
1615 rep . on ( 'message' , function ( msg ) {
1716 msg . should . be . an . instanceof ( Buffer ) ;
@@ -25,14 +24,10 @@ describe('socket.monitor', function() {
2524 // Test the endpoint addr arg
2625 event_endpoint_addr . toString ( ) . should . equal ( 'tcp://127.0.0.1:5423' ) ;
2726
28- // If this is a disconnect event we can now close the rep socket
29- if ( e === 'disconnect' ) {
30- rep . close ( ) ;
31- }
32-
3327 testedEvents . pop ( ) ;
3428 if ( testedEvents . length === 0 ) {
3529 rep . unmonitor ( ) ;
30+ rep . close ( ) ;
3631 done ( ) ;
3732 }
3833 } ) ;
@@ -62,7 +57,7 @@ describe('socket.monitor', function() {
6257
6358 // We will try to connect to a non-existing server, zmq will issue events: "connect_retry", "close", "connect_retry"
6459 // The connect_retry will be issued immediately after the close event, so we will measure the time between the close
65- // event and connect_retry event, those should >= 10 (this will tell us that we are reading 1 event at a time from
60+ // event and connect_retry event, those should >= 9 (this will tell us that we are reading 1 event at a time from
6661 // the monitor socket).
6762
6863 var closeTime ;
@@ -74,7 +69,7 @@ describe('socket.monitor', function() {
7469 var diff = Date . now ( ) - closeTime ;
7570 req . unmonitor ( ) ;
7671 req . close ( ) ;
77- diff . should . be . within ( 10 , 20 ) ;
72+ diff . should . be . within ( 9 , 20 ) ;
7873 done ( ) ;
7974 } ) ;
8075
0 commit comments