Retry E2E tests on failure if running in CI. (#995)

* Retry E2E tests in CI

* newsfile
This commit is contained in:
Will Hunt 2024-11-29 09:32:18 +00:00 committed by GitHub
parent d550077f3e
commit 283375c6c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 0 deletions

1
changelog.d/995.misc Normal file
View File

@ -0,0 +1 @@
Retry e2e tests in CI due to container creation flakiness.

View File

@ -9,6 +9,7 @@ const config: Config = {
// The root directory that Jest should scan for tests and modules within
rootDir: "spec-lib",
testTimeout: 60000,
setupFiles: ["<rootDir>/spec/setup-jest.js"],
};
export default config;

2
spec/setup-jest.ts Normal file
View File

@ -0,0 +1,2 @@
// In CI, the network creation for the homerunner containers can race (https://github.com/matrix-org/complement/issues/720).
jest.retryTimes(process.env.CI ? 3 : 1);