Skip to content

Commit 7ed00ca

Browse files
hsbtclaude
authored andcommitted
[ruby/rubygems] Take one timestamp per multi-source repo build
Stamping each solo_gem with its own Time.now.utc lets the two dates drift apart and matches neither the surrounding before block. Snapshot the time once so the cooldown window stays stable as thresholds tighten. ruby/rubygems@69c6d876d4 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent fadf8f0 commit 7ed00ca

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

spec/bundler/install/cooldown_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,13 @@
489489
end
490490

491491
it "keeps a top-level source cooldown through a partial update with multiple sources" do
492+
now = Time.now.utc
492493
build_repo4 do
493494
build_gem "solo_gem", "1.0.0" do |s|
494-
s.date = Time.now.utc - (30 * 86_400)
495+
s.date = now - (30 * 86_400)
495496
end
496497
build_gem "solo_gem", "2.0.0" do |s|
497-
s.date = Time.now.utc - (1 * 86_400)
498+
s.date = now - (1 * 86_400)
498499
end
499500
end
500501

@@ -537,12 +538,13 @@
537538
end
538539

539540
it "carries cooldown declared on a gem-block source" do
541+
now = Time.now.utc
540542
build_repo4 do
541543
build_gem "solo_gem", "1.0.0" do |s|
542-
s.date = Time.now.utc - (30 * 86_400)
544+
s.date = now - (30 * 86_400)
543545
end
544546
build_gem "solo_gem", "2.0.0" do |s|
545-
s.date = Time.now.utc - (1 * 86_400)
547+
s.date = now - (1 * 86_400)
546548
end
547549
end
548550

0 commit comments

Comments
 (0)