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

Threadsafe manticore client #526

Merged
merged 2 commits into from
Sep 30, 2015

Conversation

davidbegin
Copy link
Collaborator

No description provided.

David Abdemoulaie and others added 2 commits September 29, 2015 20:48
ManticoreAdapter was not thread-safe. Multiple threads would access
the same Client instance, which stored @uri, @method, and @options.
Multiple concurrent requests would cause data inconsistencies and
map responses to the incorrect request.

Fixing the thread-safety exposed several failing tests in the Manticore
specs. The gist of this is, Webmock allows you to stub with headers that
have Array values. e.g. `:headers => { 'Accept' => ['image/jpg', 'image/png'] }

However, you cannot pass an Array as a header value to the Manticore library.
It is the user's responsibility to concatenate this to a comma-separated string.

In order to match the configured stub, you have to naively split all
header values containing a comma into an Array, before attempting to match.

This feels wrong. However, I don't know a better way of doing it. My Webmock-fu
is weak.
davidbegin added a commit that referenced this pull request Sep 30, 2015
@davidbegin davidbegin merged commit f74a0b6 into bblimke:master Sep 30, 2015
@davidbegin davidbegin deleted the threadsafe-manticore-client branch September 30, 2015 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants