faq
labelnode node_modules/.bin/mocha --version
(Local) and mocha --version
(Global). We recommend avoiding the use of globally installed Mocha.Expected behavior: [What you expect to happen]
Actual behavior: [What actually happens]
Reproduces how often: [What percentage of the time does it reproduce?]
mocha --version
and node node_modules/.bin/mocha --version
:node --version
:describe('kafka', () => {
it('send', done => {
kafka.send(
[
{
topic: 'a2213d_kafka_test',
messages: [
'你好',
'Your are good!'
]
}
],
(err, data) => {
try {
should.not.exist(err);
should.exist(data);
console.log('kafka.test.js, kafka.send', data);
done();
}
catch (ex) {
done(ex);
}
}
);
});
});
this test itself will run successfully, but after that, the terminal will hold on, refusing to exit so that i can type another command.
but this will not happen in sync method tests.
@seelikes probably the Kafka connection is not closed, the issue is not reproducible when substituting kafka with any other async task (Promises or async/await).
@Bamieh
you are right, i checked my code and found that the producer which produce messages to kafka was never closed. amazing, thank you very much.