diff --git a/lib/baseClient.js b/lib/baseClient.js index 1c2ba246..aeb97038 100644 --- a/lib/baseClient.js +++ b/lib/baseClient.js @@ -253,7 +253,7 @@ Client.prototype.createTopics = function (topics, isAsync, cb) { if (typeof isAsync === 'function' && typeof cb === 'undefined') { cb = isAsync; - isAsync = true; + isAsync = false; } try { @@ -299,7 +299,7 @@ Client.prototype.createTopics = function (topics, isAsync, cb) { }); }); - if (!isAsync) { + if (isAsync) { cb(null); } }; diff --git a/test/test.offset.js b/test/test.offset.js index 98aaec4f..f77f6f97 100644 --- a/test/test.offset.js +++ b/test/test.offset.js @@ -14,7 +14,7 @@ describe('Offset', function () { client = new Client(); producer = new Producer(client); producer.on('ready', function () { - producer.createTopics(['_exist_topic_3_test'], true, function (err) { + producer.createTopics(['_exist_topic_3_test'], false, function (err) { done(err); }); }); diff --git a/test/test.producer.js b/test/test.producer.js index d554d167..04c2bd68 100644 --- a/test/test.producer.js +++ b/test/test.producer.js @@ -21,7 +21,7 @@ var client, producer, noAckProducer, producerKeyed; suiteTimeout: 30000 } ].forEach(function (testParameters) { - var TOPIC_POSTFIX = '_test_' + Date.now(); + var TOPIC_POSTFIX = '_test_' + uuid.v4(); var EXISTS_TOPIC_3 = '_exists_3' + TOPIC_POSTFIX; var sslOptions = testParameters.sslOptions;