Merge pull request #34421 from backstage/freben/mysql-connect-timeout
fix(backend-test-utils): increase MySQL connect and pool timeouts
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-test-utils': patch
|
||||
---
|
||||
|
||||
Increased MySQL connection and pool timeouts to reduce flaky `connect ETIMEDOUT` failures in CI. The test MySQL container now also uses `mysql_native_password` for cheaper connection handshakes and disables binary logging.
|
||||
@@ -56,6 +56,10 @@ export async function startMysqlContainer(image: string): Promise<{
|
||||
.withExposedPorts(3306)
|
||||
.withEnvironment({ MYSQL_ROOT_PASSWORD: password })
|
||||
.withTmpFs({ '/var/lib/mysql': 'rw' })
|
||||
.withCommand([
|
||||
'--default-authentication-plugin=mysql_native_password',
|
||||
'--skip-log-bin',
|
||||
])
|
||||
.start();
|
||||
|
||||
const host = container.getHost();
|
||||
@@ -176,6 +180,7 @@ export class MysqlEngine implements Engine {
|
||||
connection: {
|
||||
...this.#connection,
|
||||
database: databaseName,
|
||||
connectTimeout: 30_000,
|
||||
},
|
||||
...LARGER_POOL_CONFIG,
|
||||
});
|
||||
|
||||
@@ -129,5 +129,7 @@ export const LARGER_POOL_CONFIG = {
|
||||
pool: {
|
||||
min: 0,
|
||||
max: 50,
|
||||
acquireTimeoutMillis: 30_000,
|
||||
createTimeoutMillis: 30_000,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user