Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make global stubs thread-safe #908

Merged
merged 1 commit into from Oct 12, 2020
Merged

Commits on Oct 12, 2020

  1. Make global stubs thread-safe

    This fixes an issue where testing multi-threaded code could sometimes result in incorrect responses being returned. Specifically in the case of VCR, since it seems to mock a nil response first before stubbing the real value, a nil response could sometimes be returned. This was because the hash being used by global stubs is not thread-safe.
    
    I tried to write a test for this, but given the multi-threaded nature, and the fact it doesn't happen on MRI, it was difficult to find anything that failed. The existing tests do at least regression test it though.
    
    closes bblimke#907
    Adam Harwood committed Oct 12, 2020
    Copy the full SHA
    f7a1beb View commit details
    Browse the repository at this point in the history