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.
Issue#
#1700
Description:
In my project, I have a lot of specs, so I run them in parallel to get quicker results, usually in a few threads. I also have some special specs dealing with mocked data, where I need a random first name, but it can't be the same as the initial data. At this point, I started to use the unique generators, something like this:
It worked fine when I was running only one of the tests, but as soon as I started them in parallel, they became flaky and sometimes it even generated the excluded first name.
I saw that others also had problems with thread safety, so here I am, trying to fix it. I added two new test cases, one is checking the thread safety of the Config.random (code derived from the linked isssue), the other is covering my problem with unique generators having their own sets of exlusions.
I hope my PR helps and could be merged soon, just let me know if you need anything