(clientQueryTimeoutMs)
| 197 | } |
| 198 | |
| 199 | async function setUp(clientQueryTimeoutMs) { |
| 200 | const sequelize = Support.createSequelizeInstance({ |
| 201 | dialectOptions: { |
| 202 | statement_timeout: 500, // ms |
| 203 | query_timeout: clientQueryTimeoutMs |
| 204 | }, |
| 205 | pool: { |
| 206 | max: 1, // having only one helps us know whether the connection was invalidated |
| 207 | idle: 60000 |
| 208 | } |
| 209 | }); |
| 210 | |
| 211 | return { sequelize, originalPid: await getConnectionPid(sequelize) }; |
| 212 | } |
| 213 | |
| 214 | async function getConnectionPid(sequelize) { |
| 215 | const connection = await sequelize.connectionManager.getConnection(); |
no test coverage detected