Skip to content

Commit

Permalink
[misc] ensure timeout test reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Mar 20, 2020
1 parent c5e1c2d commit 90170fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/integration/test-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('basic query', () => {
});

it('timeout', function(done) {
this.timeout(10000);
this.timeout(20000);
const initTime = Date.now();
const query =
'select c1.* from information_schema.columns as c1, ' +
Expand All @@ -268,7 +268,7 @@ describe('basic query', () => {
});

it('timeout with parameter', function(done) {
this.timeout(10000);
this.timeout(20000);
const initTime = Date.now();
const query =
'select c1.* from information_schema.columns as c1, ' +
Expand All @@ -284,7 +284,7 @@ describe('basic query', () => {
const testTimeout = (done, initTime, err) => {
if (shareConn.info.isMariaDB() && shareConn.info.hasMinVersion(10, 1, 2)) {
const elapse = Date.now() - initTime;
assert.isOk(elapse < 3000, 'elapse time was ' + elapse + ' but must be less around 100');
assert.isOk(elapse < 5000, '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 90170fd

Please sign in to comment.