Repository navigation
Conversation
The test starts three LocalCluster peers named "commanded1" to
"commanded3", while the test node is named "manager". Every peer starts
Mox, which registers {:global, Mox.Server}. If a peer registers the name
before it has synced with the test node, :global resolves the conflict
with random_exit_name/3. That function keeps the process on the node
whose name sorts first and kills the other one. "commanded..." sorts
before "manager", so the test node's Mox.Server was sometimes killed.
Every later test that uses Mox then failed with no process or no
connection errors for {:global, Mox.Server}.
Use the prefix "peer" so the test node always sorts first and keeps its
Mox.Server, whatever the timing of the sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
distributed_subscriptions_test.exssometimes kills the test node'sMox.Server, and every later test that usesMockEventStoreCasethen fails onGenServer.call({:global, Mox.Server}, ...)with "no process". On OTP 27 it happened in 1 of 20 runs of four test files. On OTP 29, three full runs ofmix test --include distributedon main had 75, 73 and 35 failures out of 501 tests.Each peer starts
:commandedwith all its applications, Mox included, and Mox registers{:global, Mox.Server}. When a peer registers before:globalhas synced with the test node,:globalsettles the clash by killing the copy on the node whose name sorts higher. The peers are namedcommanded1tocommanded3, which sort beforemanager, so the test node's copy is the one that dies.This renames the peers to
peer1topeer3, which sort aftermanager, so the test node's copy always survives. A comment in the test explains why the prefix matters. After the change the same 20 runs on OTP 27 and three full runs on OTP 29 pass. Only test code changes.