💚 Use a unique registry for every test#143
Closed
randycoulman wants to merge 3 commits intomainfrom
Closed
Conversation
Moves all of the via_tuple construction to a single place to make it easier to use a per-process Registry in tests.
Start a uniquely-named Registry for each test, injecting it into the code using the [ProcessTree](https://hexdocs.pm/process_tree/ProcessTree.html) library. Allow tests to start their own Registry and pass it into the `start_config_cat` helper function for the one that needs to refer to the exact same registry.
Member
|
Hey @randycoulman, |
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.
Describe the purpose of your pull request
In order to fix the frequently-failing tests, this takes a different approach in addition to running many of the tests synchronously.
It seems as though our ConfigCat instances aren't fully shutting down and removing themselves from the Registry before the next test starts, even though they should be doing that.
Instead, we start a uniquely-named Registry for each test, injecting it into the code using the ProcessTree library.
We allow tests to start their own Registry and pass it into the
start_config_cathelper function for the one that needs to refer to the exact same registry.To make this cleaner, we extract a
via_tuplehelper function into a newConfigCat.Registrymodule so that we can localize the lookup of the registry to use.This is an alternative to #142.
Related issues (only if applicable)
Provide links to issues relating to this pull request
Requirement checklist (only if applicable)