Skip to content

Commit 07d969b

Browse files
Improve 'should return ready messages on partition EOF' test (#828)
1 parent 6b3c1f2 commit 07d969b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

e2e/both.spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,13 @@ describe('Consumer/Producer', function() {
190190
var consumeNone = function() {
191191
// With no new messages, the consume should wait whole timeout
192192
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);
194197
consumer.consume(100000, function(err, messages) {
195198
t.ifError(err);
196-
t.ok(Date.now() - start >= 998);
199+
t.ok(Date.now() - start >= 1998);
197200
t.equal(messages.length, 0);
198201

199202
// Produce one message to cause EOF with waiting message when consuming all

0 commit comments

Comments
 (0)