Skip to content

Commit

Permalink
Add some missing test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
whitfin committed Nov 24, 2024
1 parent 24ba777 commit b96dfac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/cachex/router/ring_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ defmodule Cachex.Router.RingTest do
# convert the name to a cache and sort
cache = Services.Overseer.retrieve(cache)

# verify that only the manage was attached to the ring
# verify that only the manager was attached to the ring
assert Cachex.Router.nodes(cache) == {:ok, [node()]}

# spawn a new member inside the cache cluster
{:ok, [_member1]} = LocalCluster.start(cluster, 1)

:timer.sleep(250)
# wait for detection
:timer.sleep(100)

# make sure that the exclusion applies on newly detected nodes
assert Cachex.Router.nodes(cache) == {:ok, [node()]}
Expand All @@ -155,6 +157,9 @@ defmodule Cachex.Router.RingTest do
test "matching node names against include/exclude params" do
name = Atom.to_string(node())

# when neither include/exclude are provided, all are valid
assert Cachex.Router.Ring.included?(node(), [], [])

# accepting all patterns will always return truthy
assert Cachex.Router.Ring.included?(node(), [".*"], [])

Expand Down

0 comments on commit b96dfac

Please sign in to comment.