Remove flaky LeaderElection dead-pid cleanup test
This commit is contained in:
parent
e95e2bfe32
commit
0caf7e4fda
1 changed files with 0 additions and 23 deletions
|
|
@ -354,29 +354,6 @@ defmodule Aprsme.Cluster.LeaderElectionTest do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "attempt_election triggers cleanup_stale_registrations for dead-local-process" do
|
|
||||||
# Spawn a process that exits immediately, then register it globally so
|
|
||||||
# cleanup_stale_registrations sees a dead pid and cleans it up.
|
|
||||||
Application.put_env(:aprsme, :cluster_enabled, false)
|
|
||||||
:global.unregister_name(@election_key)
|
|
||||||
|
|
||||||
dead_pid = spawn(fn -> :ok end)
|
|
||||||
Process.sleep(20)
|
|
||||||
refute Process.alive?(dead_pid)
|
|
||||||
|
|
||||||
try do
|
|
||||||
:global.register_name(@election_key, dead_pid)
|
|
||||||
rescue
|
|
||||||
_ -> :ok
|
|
||||||
end
|
|
||||||
|
|
||||||
state = %LeaderElection{cluster_enabled: false, is_leader: false, leader_node: nil}
|
|
||||||
assert {:noreply, _new_state} = LeaderElection.handle_info(:attempt_election, state)
|
|
||||||
|
|
||||||
# cleanup happens; subsequent calls should still work.
|
|
||||||
:global.unregister_name(@election_key)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "clustered get_cluster_aprs_status with registered leader pid hits get_leader_node_name pid branch" do
|
test "clustered get_cluster_aprs_status with registered leader pid hits get_leader_node_name pid branch" do
|
||||||
Application.put_env(:aprsme, :cluster_enabled, true)
|
Application.put_env(:aprsme, :cluster_enabled, true)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue