mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
new test for actual statement timeout
This commit is contained in:
parent
175b688b90
commit
64eb77e94c
@ -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()
|
||||
})
|
||||
}))
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user