schism
schism copied to clipboard
Possible incompatibility with OTP 25
OTP 25 has turned on by default the prevent_overlapping_partitions Kernel option. Since updating to this version of OTP, my tests that rely on schism
to create partitions started to fail, and I see the following output:
2) test distributed heartbeat monitor - splitting off two nodes marks their caches as unhealthy (MyAppWeb.HeartbeatServiceTest)
test/my_app_web/services/heartbeat_test.exs:143
** (MatchError) no match of right hand side value: :pang
code: Schism.partition([first, second])
stacktrace:
(schism 1.0.1) lib/schism.ex:53: anonymous fn/5 in Schism.partition/2
(elixir 1.13.4) lib/enum.ex:2396: Enum."-reduce/3-lists^foldl/2-0-"/3
(schism 1.0.1) lib/schism.ex:41: Schism.partition/2
test/my_app_web/services/heartbeat_test.exs:149: (test)
The following output was logged:
14:41:57.283 [warning] 'global' at node :"[email protected]" requested disconnect from node :"[email protected]" in order to prevent overlapping partitions
14:41:57.284 [warning] 'global' at node :"[email protected]" requested disconnect from node :"[email protected]" in order to prevent overlapping partitions
14:41:57.284 [warning] 'global' at node :"[email protected]" requested disconnect from node :"[email protected]" in order to prevent overlapping partitions
14:41:57.285 [warning] 'global' at node :"[email protected]" requested disconnect from node :"[email protected]" in order to prevent overlapping partitions
The code that triggers this looks like this:
test "splitting off two nodes marks their caches as unhealthy", %{nodes: nodes} do
[first | [second | rest]] = nodes
assert :connected = :rpc.call(first, CacheState, :state, [])
Schism.partition([first, second]) # <- Line raising the error
Schism.partition(rest)
[...]
end
Sorted out the proper syntax to disable:
ELIXIR_ERL_OPTIONS='-kernel prevent_overlapping_partitions false' mix test