Skip to content

Commit 3b59d95

Browse files
committed
Fix
1 parent e74ba69 commit 3b59d95

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎lib/benchmark_suite.rb‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ def benchmark_env(ruby)
180180
end
181181
end
182182

183+
# Clear Bundler environment variables to prevent the parent's bundle context
184+
# from leaking into benchmark subprocesses. Benchmarks that need Bundler will
185+
# set up their own context via use_gemfile in the harness.
186+
# This is especially important when running tests under `bundle exec rake test`.
187+
["BUNDLE_GEMFILE", "BUNDLE_BIN_PATH", "BUNDLE_PATH", "BUNDLER_VERSION",
188+
"BUNDLER_SETUP", "RUBYOPT", "RUBYLIB"].each do |var|
189+
env[var] = nil if ENV.key?(var)
190+
end
191+
183192
env
184193
end
185194

0 commit comments

Comments
 (0)