Skip to content

Commit 684275b

Browse files
committed
Improve coverage
1 parent 73003d7 commit 684275b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/lightning/distributed_rate_limiter_test.exs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ defmodule Lightning.DistributedRateLimiterTest do
66

77
@default_capacity 10
88

9+
describe "inspect_table/0" do
10+
test "shows the process info of the ets" do
11+
%{table: table} =
12+
Horde.DynamicSupervisor.which_children(Lightning.DistributedSupervisor)
13+
|> then(fn [{:undefined, pid, :worker, _name}] ->
14+
:sys.get_state(pid)
15+
end)
16+
17+
ets_info = :ets.info(table)
18+
assert ^ets_info = DistributedRateLimiter.inspect_table()
19+
assert Keyword.has_key?(ets_info, :node)
20+
end
21+
end
22+
923
describe "check_rate/2" do
1024
test "allows up to the capacity and refills on multiple buckets" do
1125
initial_capacity = @default_capacity

0 commit comments

Comments
 (0)