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 () {
52
52
var time = Date . now ( ) ;
53
53
client . auth ( auth , function ( err , res ) {
54
54
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 ) ) ;
57
59
done ( ) ;
58
60
} ) ;
59
61
var tmp = client . command_queue . get ( 0 ) . callback ;
You can’t perform that action at this time.
0 commit comments