From 1719f79e1007abdb218048fc01f071b9fba8c90a Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Fri, 29 Nov 2024 09:18:24 +0000 Subject: [PATCH] Retry E2E tests in CI --- jest.config.ts | 1 + spec/setup-jest.ts | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 spec/setup-jest.ts diff --git a/jest.config.ts b/jest.config.ts index c6f38e15..21432ec3 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -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: ["/spec/setup-jest.js"], }; export default config; diff --git a/spec/setup-jest.ts b/spec/setup-jest.ts new file mode 100644 index 00000000..a5481961 --- /dev/null +++ b/spec/setup-jest.ts @@ -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); \ No newline at end of file