(n, cb)
| 5 | describe('many errors', function () { |
| 6 | it('functions properly without segfault', function (done) { |
| 7 | const throwError = function (n, cb) { |
| 8 | const client = new Client() |
| 9 | client.connectSync() |
| 10 | |
| 11 | const doIt = function (n, cb) { |
| 12 | client.query('select asdfiasdf', function (err) { |
| 13 | assert(err, 'bad query should emit an error') |
| 14 | cb(null) |
| 15 | }) |
| 16 | } |
| 17 | |
| 18 | async.timesSeries(10, doIt, function (err) { |
| 19 | if (err) return cb(err) |
| 20 | client.end(cb) |
| 21 | }) |
| 22 | } |
| 23 | |
| 24 | async.times(10, throwError, done) |
| 25 | }) |