(x, done)
| 3 | const ok = require('okay') |
| 4 | |
| 5 | const execute = function (x, done) { |
| 6 | const client = new Client() |
| 7 | client.connectSync() |
| 8 | const query = function (n, cb) { |
| 9 | client.query('SELECT $1::int as num', [n], function (err) { |
| 10 | cb(err) |
| 11 | }) |
| 12 | } |
| 13 | return async.timesSeries( |
| 14 | 5, |
| 15 | query, |
| 16 | ok(done, function () { |
| 17 | client.end() |
| 18 | done() |
| 19 | }) |
| 20 | ) |
| 21 | } |
| 22 | describe('Load tests', function () { |
| 23 | it('single client and many queries', function (done) { |
| 24 | async.times(1, execute, done) |