Skip to content

Commit

Permalink
Fix adapter test
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 committed Sep 12, 2024
1 parent d77de85 commit d1e3d4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/solid_cable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def autotrim?
end

def trim_batch_size
if (size = cable_config.trim_batch_size.to_i) < 2
if (size = cable_config.trim_batch_size.to_i) < 1
100
else
size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ActionCable::SubscriptionAdapter::SolidCableTest < ActionCable::TestCase

test "trims_after_unsubscribe" do
SolidCable.stub(:trim_chance, 99.999) do
with_cable_config message_retention: "1.second", trim_batch_size: 2 do
with_cable_config message_retention: "2.seconds", trim_batch_size: 1 do
subscribe_as_queue("channel") do |queue|
4.times do
@tx_adapter.broadcast("channel", "hello world")
Expand All @@ -73,7 +73,7 @@ class ActionCable::SubscriptionAdapter::SolidCableTest < ActionCable::TestCase

queue.clear
end
assert_equal 0, SolidCable::Message.where(channel: "channel").count
assert_equal 1, SolidCable::Message.where(channel: "channel").count
end
end
end
Expand Down

0 comments on commit d1e3d4b

Please sign in to comment.