Skip to content

Commit b5432bd

Browse files
hsbtclaude
authored andcommitted
[ruby/rubygems] Fix retry spec to restore default_base_delay for backoff test
The "is enabled by default with 1 second base delay" test relies on default_base_delay being 1.0, but spec_helper sets it to 0 globally. Temporarily restore it to 1.0 within the test. ruby/rubygems@427525d4a6 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent eeda69b commit b5432bd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

spec/bundler/bundler/retry_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
end
9595

9696
it "is enabled by default with 1 second base delay" do
97+
original_base_delay = Bundler::Retry.default_base_delay
98+
Bundler::Retry.default_base_delay = 1.0
99+
97100
attempts = 0
98101
sleep_times = []
99102

@@ -114,6 +117,8 @@
114117
expect(sleep_times[0]).to eq(1.0)
115118
# Second retry: 1.0 * 2^1 = 2.0
116119
expect(sleep_times[1]).to eq(2.0)
120+
ensure
121+
Bundler::Retry.default_base_delay = original_base_delay
117122
end
118123

119124
it "sleeps with exponential backoff when base_delay is set" do

0 commit comments

Comments
 (0)