()
| 87 | it('can close multiple times on a pool', async function () { |
| 88 | const pool = new pg.Pool({ max: 1 }) |
| 89 | const run = async () => { |
| 90 | const cursor = new Cursor(text) |
| 91 | const client = await pool.connect() |
| 92 | client.query(cursor) |
| 93 | await new Promise((resolve) => { |
| 94 | cursor.read(25, function (err) { |
| 95 | assert.ifError(err) |
| 96 | cursor.close(function (err) { |
| 97 | assert.ifError(err) |
| 98 | client.release() |
| 99 | resolve() |
| 100 | }) |
| 101 | }) |
| 102 | }) |
| 103 | } |
| 104 | await Promise.all([run(), run(), run()]) |
| 105 | await pool.end() |
| 106 | }) |