Skip to content

Commit

Permalink
[CONJS-17] pool testing stability correction
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Jul 16, 2018
1 parent 52616f0 commit 2925ec0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/integration/test-pool-callback.js
Expand Up @@ -145,7 +145,7 @@ describe("Pool callback", () => {
assert.equal(pool.activeConnections(), 10);
assert.equal(pool.totalConnections(), 10);
assert.equal(pool.idleConnections(), 0);
assert.equal(pool.taskQueueSize(), 9990);
assert.isOk(pool.taskQueueSize() > 9950);

setTimeout(() => {
pool.end();
Expand Down
11 changes: 8 additions & 3 deletions test/integration/test-pool.js
Expand Up @@ -90,9 +90,14 @@ describe("Pool", () => {
this.timeout(5000);
const pool = base.createPool({ connectionLimit: 1, acquireTimeout: 500 });
const initTime = Date.now();
pool.query("SELECT SLEEP(2)").then(() => {
pool.end();
});
pool.query("SELECT SLEEP(2)")
.then(() => {
pool.end();
})
.catch(() => {
pool.end();
});

pool
.query("SELECT 1")
.then(() => {
Expand Down

0 comments on commit 2925ec0

Please sign in to comment.