diff --git a/services/chat/Makefile b/services/chat/Makefile index 353c26f0b0..d2a8aeb07c 100644 --- a/services/chat/Makefile +++ b/services/chat/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = chat BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/chat/docker-compose.ci.yml b/services/chat/docker-compose.ci.yml index 18c28b0321..860a7661b6 100644 --- a/services/chat/docker-compose.ci.yml +++ b/services/chat/docker-compose.ci.yml @@ -25,6 +25,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: MONGO_HOST: mongo POSTGRES_HOST: postgres MOCHA_GREP: ${MOCHA_GREP} diff --git a/services/chat/docker-compose.yml b/services/chat/docker-compose.yml index ca8ba2a5d6..871197af6a 100644 --- a/services/chat/docker-compose.yml +++ b/services/chat/docker-compose.yml @@ -35,6 +35,7 @@ services: - ../../tools/migrations:/overleaf/tools/migrations working_dir: /overleaf/services/chat environment: + RETRIES: MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf POSTGRES_HOST: postgres MOCHA_GREP: ${MOCHA_GREP} diff --git a/services/chat/package.json b/services/chat/package.json index e8d7a3e58d..6505bebcf0 100644 --- a/services/chat/package.json +++ b/services/chat/package.json @@ -9,7 +9,7 @@ "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "nodemon": "node --watch app.js", - "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:unit:_run": "mocha --recursive --exit $@ test/unit/js", "lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .", "lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .", diff --git a/services/clsi/Makefile b/services/clsi/Makefile index 202ec397c3..9b6dcdb5f0 100644 --- a/services/clsi/Makefile +++ b/services/clsi/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = clsi BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/clsi/docker-compose.ci.yml b/services/clsi/docker-compose.ci.yml index a049e9798c..524ee04b61 100644 --- a/services/clsi/docker-compose.ci.yml +++ b/services/clsi/docker-compose.ci.yml @@ -21,6 +21,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: MONGO_HOST: mongo POSTGRES_HOST: postgres MOCHA_GREP: ${MOCHA_GREP} diff --git a/services/clsi/docker-compose.yml b/services/clsi/docker-compose.yml index f62074431e..4207048e1f 100644 --- a/services/clsi/docker-compose.yml +++ b/services/clsi/docker-compose.yml @@ -34,6 +34,7 @@ services: - /var/run/docker.sock:/var/run/docker.sock working_dir: /overleaf/services/clsi environment: + RETRIES: MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf POSTGRES_HOST: postgres MOCHA_GREP: ${MOCHA_GREP} diff --git a/services/clsi/package.json b/services/clsi/package.json index 06d7062786..374efddc97 100644 --- a/services/clsi/package.json +++ b/services/clsi/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "start": "node app.js", - "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:unit:_run": "vitest --config ./vitest.config.unit.cjs", "test:unit": "npm run test:unit:_run", diff --git a/services/contacts/Makefile b/services/contacts/Makefile index cdffce25c4..875221fd04 100644 --- a/services/contacts/Makefile +++ b/services/contacts/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = contacts BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/contacts/docker-compose.ci.yml b/services/contacts/docker-compose.ci.yml index 6db5bd7663..a24dec009c 100644 --- a/services/contacts/docker-compose.ci.yml +++ b/services/contacts/docker-compose.ci.yml @@ -25,6 +25,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: MONGO_HOST: mongo POSTGRES_HOST: postgres MOCHA_GREP: ${MOCHA_GREP} diff --git a/services/contacts/docker-compose.yml b/services/contacts/docker-compose.yml index 328417a564..3d75f019af 100644 --- a/services/contacts/docker-compose.yml +++ b/services/contacts/docker-compose.yml @@ -35,6 +35,7 @@ services: - ../../tools/migrations:/overleaf/tools/migrations working_dir: /overleaf/services/contacts environment: + RETRIES: MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf POSTGRES_HOST: postgres MOCHA_GREP: ${MOCHA_GREP} diff --git a/services/contacts/package.json b/services/contacts/package.json index 39f62e3f0b..7075353fb4 100644 --- a/services/contacts/package.json +++ b/services/contacts/package.json @@ -6,7 +6,7 @@ "main": "app.js", "scripts": { "start": "node app.js", - "test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:unit:_run": "mocha --loader=esmock --recursive --exit $@ test/unit/js", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", diff --git a/services/docstore/Makefile b/services/docstore/Makefile index fe978193f5..dfcd5f7ea6 100644 --- a/services/docstore/Makefile +++ b/services/docstore/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = docstore BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/docstore/docker-compose.ci.yml b/services/docstore/docker-compose.ci.yml index 19c3b8fe73..46ff9f29f2 100644 --- a/services/docstore/docker-compose.ci.yml +++ b/services/docstore/docker-compose.ci.yml @@ -27,6 +27,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: MONGO_HOST: mongo POSTGRES_HOST: postgres GCS_API_ENDPOINT: http://gcs:9090 diff --git a/services/docstore/docker-compose.yml b/services/docstore/docker-compose.yml index 00c1f694e9..b35bbded85 100644 --- a/services/docstore/docker-compose.yml +++ b/services/docstore/docker-compose.yml @@ -36,6 +36,7 @@ services: - ../../tools/migrations:/overleaf/tools/migrations working_dir: /overleaf/services/docstore environment: + RETRIES: MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf POSTGRES_HOST: postgres GCS_API_ENDPOINT: http://gcs:9090 diff --git a/services/docstore/package.json b/services/docstore/package.json index d397bf3f51..513befd8ab 100644 --- a/services/docstore/package.json +++ b/services/docstore/package.json @@ -6,7 +6,7 @@ "main": "app.js", "scripts": { "start": "node app.js", - "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:unit:_run": "vitest --config ./vitest.config.unit.cjs", "test:unit": "npm run test:unit:_run", diff --git a/services/document-updater/Makefile b/services/document-updater/Makefile index 380a335313..1b9f8ffd72 100644 --- a/services/document-updater/Makefile +++ b/services/document-updater/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = document-updater BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/document-updater/docker-compose.ci.yml b/services/document-updater/docker-compose.ci.yml index f66c69415f..ce23ab5dcb 100644 --- a/services/document-updater/docker-compose.ci.yml +++ b/services/document-updater/docker-compose.ci.yml @@ -32,6 +32,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: REDIS_HOST: redis_test QUEUES_REDIS_HOST: redis_test HISTORY_REDIS_HOST: redis_test diff --git a/services/document-updater/docker-compose.yml b/services/document-updater/docker-compose.yml index 31a7d019d8..ff51e1df55 100644 --- a/services/document-updater/docker-compose.yml +++ b/services/document-updater/docker-compose.yml @@ -42,6 +42,7 @@ services: - ../../tools/migrations:/overleaf/tools/migrations working_dir: /overleaf/services/document-updater environment: + RETRIES: REDIS_HOST: redis_test HISTORY_REDIS_HOST: redis_test QUEUES_REDIS_HOST: redis_test diff --git a/services/document-updater/package.json b/services/document-updater/package.json index c0c4cf4864..9614bc2b62 100644 --- a/services/document-updater/package.json +++ b/services/document-updater/package.json @@ -5,7 +5,7 @@ "main": "app.js", "scripts": { "start": "node app.js", - "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:unit:_run": "mocha --recursive --exit $@ test/unit/js", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", diff --git a/services/filestore/Makefile b/services/filestore/Makefile index 4f289f70e6..4053817612 100644 --- a/services/filestore/Makefile +++ b/services/filestore/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = filestore BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/filestore/docker-compose.ci.yml b/services/filestore/docker-compose.ci.yml index 4b3100fa46..9a02849a19 100644 --- a/services/filestore/docker-compose.ci.yml +++ b/services/filestore/docker-compose.ci.yml @@ -25,6 +25,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: MONGO_HOST: mongo POSTGRES_HOST: postgres AWS_S3_ENDPOINT: https://minio:9000 diff --git a/services/filestore/docker-compose.yml b/services/filestore/docker-compose.yml index 8f2f591bc8..490b4e120f 100644 --- a/services/filestore/docker-compose.yml +++ b/services/filestore/docker-compose.yml @@ -38,6 +38,7 @@ services: - minio-certs:/certs working_dir: /overleaf/services/filestore environment: + RETRIES: MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf POSTGRES_HOST: postgres AWS_S3_ENDPOINT: https://minio:9000 diff --git a/services/filestore/package.json b/services/filestore/package.json index 3b0f95bbde..d7ff6360d9 100644 --- a/services/filestore/package.json +++ b/services/filestore/package.json @@ -12,7 +12,7 @@ "start": "node app.js", "nodemon": "node --watch app.js", "lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .", - "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:unit:_run": "vitest --config ./vitest.config.unit.cjs", "lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .", "types:check": "tsc --noEmit" diff --git a/services/history-v1/Makefile b/services/history-v1/Makefile index 4ea994b715..871df7922a 100644 --- a/services/history-v1/Makefile +++ b/services/history-v1/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = history-v1 BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/history-v1/docker-compose.ci.yml b/services/history-v1/docker-compose.ci.yml index 3e2ab0d32b..43f17c55bc 100644 --- a/services/history-v1/docker-compose.ci.yml +++ b/services/history-v1/docker-compose.ci.yml @@ -35,6 +35,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: REDIS_HOST: redis_test QUEUES_REDIS_HOST: redis_test HISTORY_REDIS_HOST: redis_test diff --git a/services/history-v1/docker-compose.yml b/services/history-v1/docker-compose.yml index 60233e7b34..b351d96f7e 100644 --- a/services/history-v1/docker-compose.yml +++ b/services/history-v1/docker-compose.yml @@ -52,6 +52,7 @@ services: - ../../tools/migrations:/overleaf/tools/migrations working_dir: /overleaf/services/history-v1 environment: + RETRIES: REDIS_HOST: redis_test HISTORY_REDIS_HOST: redis_test QUEUES_REDIS_HOST: redis_test diff --git a/services/history-v1/package.json b/services/history-v1/package.json index 7295652d01..db20fa236f 100644 --- a/services/history-v1/package.json +++ b/services/history-v1/package.json @@ -67,7 +67,7 @@ "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:unit:_run": "mocha --recursive --exit $@ test/unit/js", - "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "nodemon": "node --watch app.js", "migrate": "knex migrate:latest", "delete_old_chunks": "node storage/tasks/delete_old_chunks.js", diff --git a/services/notifications/Makefile b/services/notifications/Makefile index 1aa8b898f2..731d339d36 100644 --- a/services/notifications/Makefile +++ b/services/notifications/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = notifications BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/notifications/docker-compose.ci.yml b/services/notifications/docker-compose.ci.yml index f70c3645be..aa9a7e6619 100644 --- a/services/notifications/docker-compose.ci.yml +++ b/services/notifications/docker-compose.ci.yml @@ -27,6 +27,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: MONGO_HOST: mongo POSTGRES_HOST: postgres MOCHA_GREP: ${MOCHA_GREP} diff --git a/services/notifications/docker-compose.yml b/services/notifications/docker-compose.yml index f7195bce2a..abc6ceba3e 100644 --- a/services/notifications/docker-compose.yml +++ b/services/notifications/docker-compose.yml @@ -37,6 +37,7 @@ services: - ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json working_dir: /overleaf/services/notifications environment: + RETRIES: MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf POSTGRES_HOST: postgres MOCHA_GREP: ${MOCHA_GREP} diff --git a/services/project-history/Makefile b/services/project-history/Makefile index 0f10570252..1d27ade846 100644 --- a/services/project-history/Makefile +++ b/services/project-history/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = project-history BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/project-history/docker-compose.ci.yml b/services/project-history/docker-compose.ci.yml index 52cf7e3c0a..4f2579e6c3 100644 --- a/services/project-history/docker-compose.ci.yml +++ b/services/project-history/docker-compose.ci.yml @@ -32,6 +32,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: REDIS_HOST: redis_test QUEUES_REDIS_HOST: redis_test HISTORY_REDIS_HOST: redis_test diff --git a/services/project-history/docker-compose.yml b/services/project-history/docker-compose.yml index 05f0ba4d37..93438a7aae 100644 --- a/services/project-history/docker-compose.yml +++ b/services/project-history/docker-compose.yml @@ -42,6 +42,7 @@ services: - ../../tools/migrations:/overleaf/tools/migrations working_dir: /overleaf/services/project-history environment: + RETRIES: REDIS_HOST: redis_test HISTORY_REDIS_HOST: redis_test QUEUES_REDIS_HOST: redis_test diff --git a/services/project-history/package.json b/services/project-history/package.json index ef92f235b8..f247c249d0 100644 --- a/services/project-history/package.json +++ b/services/project-history/package.json @@ -9,7 +9,7 @@ "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "start": "node app.js", "nodemon": "node --watch app.js", - "test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:unit:_run": "mocha --loader=esmock --recursive --exit $@ test/unit/js", "lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .", "lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .", diff --git a/services/real-time/Makefile b/services/real-time/Makefile index 6878b7c2de..a231a6cf8a 100644 --- a/services/real-time/Makefile +++ b/services/real-time/Makefile @@ -9,6 +9,7 @@ PROJECT_NAME = real-time BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') HERE=$(shell pwd) export MONOREPO ?= $(shell cd ../../ && pwd) +export RETRIES ?= $(if $(CI),3,0) IMAGE_CI ?= ci/$(PROJECT_NAME):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME) IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER) diff --git a/services/real-time/docker-compose.ci.yml b/services/real-time/docker-compose.ci.yml index 9ed86aa1d6..22946cac56 100644 --- a/services/real-time/docker-compose.ci.yml +++ b/services/real-time/docker-compose.ci.yml @@ -30,6 +30,7 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER environment: CI: + RETRIES: REDIS_HOST: redis_test QUEUES_REDIS_HOST: redis_test HISTORY_REDIS_HOST: redis_test diff --git a/services/real-time/docker-compose.yml b/services/real-time/docker-compose.yml index b38654bca1..7a4c2b1006 100644 --- a/services/real-time/docker-compose.yml +++ b/services/real-time/docker-compose.yml @@ -36,6 +36,7 @@ services: - ../../libraries:/overleaf/libraries working_dir: /overleaf/services/real-time environment: + RETRIES: REDIS_HOST: redis_test HISTORY_REDIS_HOST: redis_test QUEUES_REDIS_HOST: redis_test diff --git a/services/real-time/package.json b/services/real-time/package.json index 283c8ff5fe..9a446cb12f 100644 --- a/services/real-time/package.json +++ b/services/real-time/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "start": "node app.js", - "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", + "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:unit:_run": "vitest --config ./vitest.config.unit.cjs", "test:unit": "npm run test:unit:_run", diff --git a/services/web/Makefile b/services/web/Makefile index 2bbac85ecc..b69e97e819 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -1,4 +1,5 @@ DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml +export RETRIES ?= $(if $(CI),3,0) BUILD_NUMBER ?= local ifeq ($(BRANCH_NAME),) diff --git a/services/web/Makefile.module b/services/web/Makefile.module index aef25c0740..ea169a92d0 100644 --- a/services/web/Makefile.module +++ b/services/web/Makefile.module @@ -2,6 +2,7 @@ BUILD_DIR_NAME ?= web export MODULE_NAME := $(notdir $(shell pwd)) MODULE_DIR := modules/$(MODULE_NAME) PROJECT_NAME = web +export RETRIES ?= $(if $(CI),3,0) export OVERLEAF_CONFIG = /overleaf/services/web/$(MODULE_DIR)/test/acceptance/config/settings.test.js export BASE_CONFIG ?= /overleaf/services/web/test/acceptance/config/settings.test.saas.js diff --git a/services/web/bin/test_acceptance_run_dir b/services/web/bin/test_acceptance_run_dir index 4c0d13c718..151af59120 100755 --- a/services/web/bin/test_acceptance_run_dir +++ b/services/web/bin/test_acceptance_run_dir @@ -9,4 +9,4 @@ if [[ "$COVERAGE_ACCEPTANCE_TESTS" == "true" ]]; then mocha_prefix+=("c8" "--reporter=clover" "--all" "--include={app.mjs,app/**/*.{mjs,js},modules/*/index.mjs,modules/*/app/**/*.{mjs,js}}" "--exclude=app/src/Features/Metadata/packageMapping.mjs" "--report-dir=${dir}") fi -"${mocha_prefix[@]}" mocha --recursive --timeout 25000 --grep="$MOCHA_GREP" --require test/acceptance/bootstrap.js "$@" +"${mocha_prefix[@]}" mocha --recursive --timeout 25000 --grep="$MOCHA_GREP" --require test/acceptance/bootstrap.js --retries="$RETRIES" "$@" diff --git a/services/web/docker-compose.ci.yml b/services/web/docker-compose.ci.yml index d29569e8d0..1e63cad3db 100644 --- a/services/web/docker-compose.ci.yml +++ b/services/web/docker-compose.ci.yml @@ -52,6 +52,7 @@ services: REDIS_HOST: redis_test COVERAGE_ACCEPTANCE_TESTS: MONOREPO: + RETRIES: extra_hosts: - "www.overleaf.test:127.0.0.1" volumes: diff --git a/services/web/docker-compose.yml b/services/web/docker-compose.yml index 8734ce5b4f..40cc0b9ae5 100644 --- a/services/web/docker-compose.yml +++ b/services/web/docker-compose.yml @@ -56,6 +56,7 @@ services: MONGO_SOCKET_TIMEOUT: 300000 REDIS_HOST: redis_test MONOREPO: + RETRIES: # OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING: 'true' extra_hosts: diff --git a/services/web/vitest.config.js b/services/web/vitest.config.js index 3dcc00520a..ff67b2cb5b 100644 --- a/services/web/vitest.config.js +++ b/services/web/vitest.config.js @@ -57,7 +57,7 @@ module.exports = defineConfig({ }, ], ...reporterOptions, - hookTimeout: COVERAGE_ENABLED ? 20_000 : 10_000, + hookTimeout: process.env.CI ? 20_000 : 10_000, coverage: { enabled: COVERAGE_ENABLED, // Add 'sequential' / 'parallel' to the folder