File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -190,10 +190,13 @@ describe('Consumer/Producer', function() {
190
190
var consumeNone = function ( ) {
191
191
// With no new messages, the consume should wait whole timeout
192
192
var start = Date . now ( ) ;
193
- consumer . setDefaultConsumeTimeout ( 1000 ) ;
193
+ // Set the timeout to 2000ms to see that it actually waits the whole time
194
+ // (Needs to be higher than fetch.max.wait.ms which is 1000 here
195
+ // to ensure we don't only wait that long)
196
+ consumer . setDefaultConsumeTimeout ( 2000 ) ;
194
197
consumer . consume ( 100000 , function ( err , messages ) {
195
198
t . ifError ( err ) ;
196
- t . ok ( Date . now ( ) - start >= 998 ) ;
199
+ t . ok ( Date . now ( ) - start >= 1998 ) ;
197
200
t . equal ( messages . length , 0 ) ;
198
201
199
202
// Produce one message to cause EOF with waiting message when consuming all
You can’t perform that action at this time.
0 commit comments