Unverified Commit 83810592 by Kewde Committed by GitHub

fix test

parent 14148c88
...@@ -11,22 +11,18 @@ describe('each', function() { ...@@ -11,22 +11,18 @@ describe('each', function() {
var total = 100000; var total = 100000;
var retrieved = 0; var retrieved = 0;
// assert fails sometimes if previous test is still running & blocking.
// so wait until it is finished.
db.wait(function() {
db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) { db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) {
if (err) throw err; if (err) throw err;
retrieved++; retrieved++;
});
db.wait(function() { if(retrieved === total) {
assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows."); assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows.");
done(); done();
}
}); });
}); });
});
it('Statement#each with complete callback', function(done) { it('Statement#each with complete callback', function(done) {
var total = 10000; var total = 10000;
var retrieved = 0; var retrieved = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment