From 3bd8e430f9a6ad30a1222bce686c5d4898f60334 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 28 Mar 2023 09:42:34 +1100 Subject: [PATCH] Use Rack::Timeout for more realistic tests The closer the test environment is to the production environment the more realistic the tests will be, and the more code we test. We are now able to test the app behaviour on timeouts which I want to do for reports. We can also catch incompatibilities with the rack-timeout gem during testing. --- .env.development | 6 ++++++ Gemfile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.env.development b/.env.development index 8f352f7e5f..15e09487f2 100644 --- a/.env.development +++ b/.env.development @@ -11,3 +11,9 @@ OFN_REDIS_URL="redis://localhost:6379/1" OFN_REDIS_JOBS_URL="redis://localhost:6379/2" SITE_URL="0.0.0.0:3000" + +# Deactivate rack-timeout in development. +# https://github.com/zombocom/rack-timeout#configuring +RACK_TIMEOUT_SERVICE_TIMEOUT="0" +RACK_TIMEOUT_WAIT_TIMEOUT="0" +RACK_TIMEOUT_WAIT_OVERTIME="0" diff --git a/Gemfile b/Gemfile index f3e2c8ca40..9b2e9ec007 100644 --- a/Gemfile +++ b/Gemfile @@ -92,6 +92,7 @@ gem 'gmaps4rails' gem 'mimemagic', '> 0.3.5' gem 'paper_trail', '~> 12.1' gem 'rack-rewrite' +gem 'rack-timeout' gem 'roadie-rails' gem 'hiredis' @@ -141,7 +142,6 @@ gem "private_address_check" group :production, :staging do gem 'ddtrace' - gem 'rack-timeout' gem 'sd_notify' # For better Systemd process management. Used by Puma. end