File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,10 @@ describe("client authentication", function () {
5252 var time = Date . now ( ) ;
5353 client . auth ( auth , function ( err , res ) {
5454 assert . strictEqual ( 'retry worked' , res ) ;
55- assert ( Date . now ( ) - time >= 200 , 'Time should be above 200 ms (the reconnect time)' ) ;
56- assert ( Date . now ( ) - time < 300 , 'Time should be below 300 ms (the reconnect should only take a bit above 200 ms)' ) ;
55+ var now = Date . now ( ) ;
56+ // Hint: setTimeout sometimes triggers early and therefor the value can be like one or two ms to early
57+ assert ( now - time >= 198 , 'Time should be above 200 ms (the reconnect time) and is ' + ( now - time ) ) ;
58+ assert ( now - time < 300 , 'Time should be below 300 ms (the reconnect should only take a bit above 200 ms) and is ' + ( now - time ) ) ;
5759 done ( ) ;
5860 } ) ;
5961 var tmp = client . command_queue . get ( 0 ) . callback ;
You can’t perform that action at this time.
0 commit comments