Skip to content

Commit 3bd8e43

Browse files
committed
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.
1 parent c34ced2 commit 3bd8e43

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.env.development

+6
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ OFN_REDIS_URL="redis://localhost:6379/1"
1111
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
1212

1313
SITE_URL="0.0.0.0:3000"
14+
15+
# Deactivate rack-timeout in development.
16+
# https://github.com/zombocom/rack-timeout#configuring
17+
RACK_TIMEOUT_SERVICE_TIMEOUT="0"
18+
RACK_TIMEOUT_WAIT_TIMEOUT="0"
19+
RACK_TIMEOUT_WAIT_OVERTIME="0"

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ gem 'gmaps4rails'
9292
gem 'mimemagic', '> 0.3.5'
9393
gem 'paper_trail', '~> 12.1'
9494
gem 'rack-rewrite'
95+
gem 'rack-timeout'
9596
gem 'roadie-rails'
9697

9798
gem 'hiredis'
@@ -141,7 +142,6 @@ gem "private_address_check"
141142

142143
group :production, :staging do
143144
gem 'ddtrace'
144-
gem 'rack-timeout'
145145
gem 'sd_notify' # For better Systemd process management. Used by Puma.
146146
end
147147

0 commit comments

Comments
 (0)