Skip to content

Commit

Permalink
new test for actual statement timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh authored and brianc committed Sep 3, 2017
1 parent 175b688 commit 64eb77e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/integration/client/statement_timeout-tests.js
Expand Up @@ -59,4 +59,19 @@ if (!helper.args.native) { // statement_timeout is not supported with the native
done()
})
})

suite.test('statement_timeout actually cancels long running queries', function (done) {
var conf = getConInfo({
'statement_timeout': '10' // 10ms to keep tests running fast
})
var client = new Client(conf)
client.connect(assert.success(function () {
client.query('SELECT pg_sleep( 1 )', function ( error ) {
client.end()
assert.strictEqual( error.code, '57014' ) // query_cancelled
done()
})
}))
})

}

0 comments on commit 64eb77e

Please sign in to comment.