Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add CAPYBARA_PUMA_THREADS to control puma threads count

Christophe Bliard983c939e8730
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index 48a9d74b818..52ffefe902d 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -85,7 +85,11 @@ RSpec.configure do |config|
end
# silence puma if we're using it
-Capybara.server = :puma, { Silent: true }
+puma_options = { Silent: true }
+# use `CAPYBARA_PUMA_THREADS=1:1` to use only 1 puma thread, which is useful
+# when using irb/pry in server code.
+puma_options[:Threads] = ENV["CAPYBARA_PUMA_THREADS"] if ENV.key?("CAPYBARA_PUMA_THREADS")
+Capybara.server = :puma, puma_options
Rails.application.config do
config.middleware.use RackSessionAccess::Middleware