ENV["RACK_ENV"] == "test" silently disables retry backoff in BazaRb#attempt
Severity: MEDIUM
Location
lib/baza-rb.rb:629,654:
sleep(seconds) unless ENV["RACK_ENV"] == "test"
Problem
Retry backoff is globally controlled by an environment variable. Three issues:
- Hidden behavior: Any code setting
RACK_ENV=test (or RAILS_ENV=test, or APP_ENV=test) disables backoff
- Inconsistency: Production behavior is controlled by an undocumented env var
- Untestable: Backoff logic cannot be tested (it is disabled in tests)
Recommended fix
Parameterize via constructor:
def initialize(..., backoff: true)
@backoff = backoff
end
Then in tests: BazaRb.new(..., backoff: false). This makes the behavior explicit and testable.
ENV["RACK_ENV"] == "test" silently disables retry backoff in BazaRb#attempt
Severity: MEDIUM
Location
lib/baza-rb.rb:629,654:Problem
Retry backoff is globally controlled by an environment variable. Three issues:
RACK_ENV=test(orRAILS_ENV=test, orAPP_ENV=test) disables backoffRecommended fix
Parameterize via constructor:
Then in tests:
BazaRb.new(..., backoff: false). This makes the behavior explicit and testable.