From f9789e974bc42f38a01f4ec7cc234ef64cc506ed Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Wed, 7 Feb 2024 11:10:17 +0800 Subject: [PATCH] DEV: Reduce pool size for test environment to 1 (#25584) Why this change? I have been investigating transaction related issues with our system tests and I have a hard time figuring out what is causing the problem. To help simplify our environment further, we will set the pool size in the test environment to 1 so that it is impossible for us to be fetching a different connection between the threads since they all share the connection pool. Also set `reaping_frequency` to `0` to ensure we don't reap any connection ensuring the same connection is always used. --- .github/workflows/tests.yml | 2 +- config/database.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2b79b3a1cd..ed04cb8844c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -242,7 +242,7 @@ jobs: if: matrix.build_type == 'system' && matrix.target == 'plugins' run: | GLOBIGNORE="plugins/chat/*"; - PREFABRICATION=0 LOAD_PLUGINS=1 RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation plugins/*/spec/system + LOAD_PLUGINS=1 RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation plugins/*/spec/system shell: bash timeout-minutes: 30 diff --git a/config/database.yml b/config/database.yml index a6d0bcf9f44..b196491c2ae 100644 --- a/config/database.yml +++ b/config/database.yml @@ -36,7 +36,8 @@ test: adapter: postgresql database: <%= test_db %> min_messages: warning - pool: 5 + pool: 1 + reaping_frequency: 0 host_names: - test.localhost