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

Duplicate interaction check needs to occur when the interaction is set up, not on replay #1

Closed
bethesque opened this issue Dec 17, 2014 · 1 comment

Comments

@bethesque
Copy link
Member

Otherwise the error does not bubble up to the client (eg the javascript client) in a helpful way, as the response may not be logged.

I, [2014-12-17T16:16:36.687916 #52188]  INFO -- : Received request POST /thing?lastName=Smith&firstName=Mary
D, [2014-12-17T16:16:36.688114 #52188] DEBUG -- : {
  "path": "/thing",
  "query": "lastName=Smith&firstName=Mary",
  "method": "post",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Origin": "http://localhost:9876",
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.8 Safari/534.34",
    "Referer": "http://localhost:9876/context.html",
    "Accept": "*/*",
    "Connection": "Keep-Alive",
    "Accept-Encoding": "gzip",
    "Accept-Language": "en-AU,*",
    "Host": "localhost:1234",
    "Version": "HTTP/1.1"
  }
}
E, [2014-12-17T16:16:36.688534 #52188] ERROR -- : Error ocurred in mock service:
E, [2014-12-17T16:16:36.688849 #52188] ERROR -- : #<RuntimeError: Interaction with same description (another request for hello) and provider state () already exists>
D, [2014-12-17T16:16:36.689348 #52188] DEBUG -- : [
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pact-mock_service-0.2.2/lib/pact/consumer/interactions_filter.rb:39:in `<<'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pact-mock_service-0.2.2/lib/pact/consumer/mock_service/interaction_replay.rb:36:in `add_verified_interaction'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pact-mock_service-0.2.2/lib/pact/consumer/mock_service/interaction_replay.rb:63:in `handle_matched_interaction'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pact-mock_service-0.2.2/lib/pact/consumer/mock_service/interaction_replay.rb:48:in `find_response'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pact-mock_service-0.2.2/lib/pact/consumer/mock_service/interaction_replay.rb:30:in `respond'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pact-mock_service-0.2.2/lib/pact/consumer/mock_service/app.rb:67:in `call'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:138:in `service'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:94:in `run'",
  "/usr/local/var/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/webrick-1.3.1/lib/webrick/server.rb:191:in `block in start_thread'"

@bethesque bethesque changed the title Duplicate error check needs to occur when the interaction is set up, not on replay Duplicate interaction check needs to occur when the interaction is set up, not on replay Dec 17, 2014
bethesque added a commit that referenced this issue Jan 3, 2015
…n is set up.

If it occurs during replay, the error does not get shown to the user.
#1
@bethesque
Copy link
Member Author

Done.

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

No branches or pull requests

1 participant