Unverified Commit 93d96dad by Kewde Committed by GitHub

test: wait for db to unlock first.

parent 65de9a7a
...@@ -11,15 +11,18 @@ describe('each', function() { ...@@ -11,15 +11,18 @@ describe('each', function() {
var total = 100000; var total = 100000;
var retrieved = 0; var retrieved = 0;
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(setTimeout(function() { db.wait(function() {
assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows."); assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows.");
done(); done();
}, 400)); });
});
}); });
it('Statement#each with complete callback', function(done) { it('Statement#each with complete callback', function(done) {
......
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