new test for actual statement timeout

This commit is contained in:
Josh 2017-08-31 08:57:02 -07:00 committed by Brian C
parent 175b688b90
commit 64eb77e94c

View File

@ -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()
})
}))
})
}