Normandy.Test.SessionRegistryContract
(normandy v2.2.0)
View Source
The ExUnit tests every Normandy.Behaviours.SessionRegistry implementation must pass.
Normandy runs them against Native, Horde and Redis; run them against yours.
defmodule MyApp.SessionRegistryTest do
use ExUnit.Case, async: true
use Normandy.Test.SessionRegistryContract, impl: MyApp.SessionRegistry
endOptions, checked when the test module compiles (a bad one raises ArgumentError):
:impl(atom/0) - Required. The module implementingNormandy.Behaviours.SessionRegistry.:new-{module, function, args}returning a fresh, empty handle, called once per test. Default:{impl, :new, []}.
Every test registers the fixed session id "s1", so each handle must start empty
(its own namespace, or async: false and a reset in a setup before the use line).
A registry may be eventually consistent: every check after a change polls whereis/2
every 10 ms for up to 3 s, and a process killed while registered must disappear within
that time.