Skip to content

Commit

Permalink
[misc] improving test reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Feb 3, 2020
1 parent 751e508 commit 22cf7b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/integration/test-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,8 @@ describe('Pool', () => {
const pool = base.createPool({
connectionLimit: 10,
minimumIdle: 4,
idleTimeout: 2
idleTimeout: 2,
acquireTimeout: 20000
});

const requests = [];
Expand Down
4 changes: 2 additions & 2 deletions test/integration/test-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ describe('basic query', () => {
})
.catch(testTimeout.bind(this, done, initTime));
});

const testTimeout = (done, initTime, err) => {
if (shareConn.info.isMariaDB() && shareConn.info.hasMinVersion(10, 1, 2)) {
console.log(err);
const elapse = Date.now() - initTime;
assert.isOk(elapse < 200, 'elapse time was ' + elapse + ' but must be less than 200');
assert.isOk(elapse < 3000, 'elapse time was ' + elapse + ' but must be less around 100');
assert.isTrue(
err.message.includes('Query execution was interrupted (max_statement_time exceeded)')
);
Expand Down

0 comments on commit 22cf7b0

Please sign in to comment.