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

random failure of spec/acceptance/httpclient/httpclient_spec.rb[1:5:1:4:4] #711

Open
lnussbaum opened this issue Jul 6, 2017 · 5 comments

Comments

@lnussbaum
Copy link

Hi,

spec/acceptance/httpclient/httpclient_spec.rb[1:5:1:4:4] fails randomly with the following error:

  1) HTTPClient when using async requests with WebMock when request stub declares that request should raise exception should raise exception after returning declared successful response first
     Failure/Error: raise @exception if @exception

     MyException:
       Exception from WebMock
     Shared Example Group: "declared responses" called from ./spec/acceptance/webmock_shared.rb:29
     Shared Example Group: "with WebMock" called from ./spec/acceptance/httpclient/httpclient_spec.rb:46
     # ./lib/webmock/response.rb:66:in `raise_error_if_any'
     # ./lib/webmock/http_lib_adapters/httpclient_adapter.rb:118:in `build_httpclient_response'
     # ./lib/webmock/http_lib_adapters/httpclient_adapter.rb:61:in `do_get'
     # ./lib/webmock/http_lib_adapters/httpclient_adapter.rb:51:in `do_get_stream'

Finished in 7.31 seconds (files took 0.83351 seconds to load)
627 examples, 1 failure

Failed examples:

rspec ./spec/acceptance/httpclient/httpclient_spec.rb[1:5:1:4:4] # HTTPClient when using async requests with WebMock when request stub declares that request should raise exception should raise exception after returning declared successful response first

To reproduce:

while rspec ./spec/acceptance/httpclient/httpclient_spec.rb ; do :; done
@lnussbaum
Copy link
Author

It also fails differently sometimes:

  1) HTTPClient when using async requests with WebMock when request stub declares that request should return a response when responses are declared to return more than once should repeat sequence of response declared number of times
     Failure/Error: expect(http_request(:get, "http://www.example.com/").body).to eq("2")

       expected: "2"
            got: "1"

       (compared using ==)
     Shared Example Group: "declared responses" called from ./spec/acceptance/webmock_shared.rb:29
     Shared Example Group: "with WebMock" called from ./spec/acceptance/httpclient/httpclient_spec.rb:46
     # ./spec/acceptance/shared/returning_declared_responses.rb:331:in `block (4 levels) in <top (required)>'

Finished in 7.41 seconds (files took 0.81591 seconds to load)
627 examples, 1 failure

Failed examples:

rspec ./spec/acceptance/httpclient/httpclient_spec.rb[1:5:1:6:16:2] # HTTPClient when using async requests with WebMock when request stub declares that request should return a response when responses are declared to return more than once should repeat sequence of response declared number of times

@lnussbaum
Copy link
Author

or:

  1) HTTPClient when using async requests with WebMock when requests are stubbed when stubbing request with a global hook should call the block only once per request
     Failure/Error: expect(call_count).to eq(1)

       expected: 1
            got: 2

       (compared using ==)
     Shared Example Group: "stubbing requests" called from ./spec/acceptance/webmock_shared.rb:27
     Shared Example Group: "with WebMock" called from ./spec/acceptance/httpclient/httpclient_spec.rb:46
     # ./spec/acceptance/shared/stubbing_requests.rb:499:in `block (4 levels) in <top (required)>'

Finished in 7.6 seconds (files took 0.81887 seconds to load)
627 examples, 1 failure

Failed examples:

rspec ./spec/acceptance/httpclient/httpclient_spec.rb[1:5:1:2:8:5] # HTTPClient when using async requests with WebMock when requests are stubbed when stubbing request with a global hook should call the block only once per request

@lnussbaum
Copy link
Author

another one:

  1) HTTPClient when using async requests with WebMock when request stub declares that request should return a response when sequences of responses are declared should return responses one by one if declared with several to_return invokations
     Failure/Error: expect(http_request(:get, "http://www.example.com/").body).to eq("2")

       expected: "2"
            got: "3"

       (compared using ==)
     Shared Example Group: "declared responses" called from ./spec/acceptance/webmock_shared.rb:29
     Shared Example Group: "with WebMock" called from ./spec/acceptance/httpclient/httpclient_spec.rb:46
     # ./spec/acceptance/shared/returning_declared_responses.rb:301:in `block (4 levels) in <top (required)>'

Finished in 9.09 seconds (files took 0.6657 seconds to load)
627 examples, 1 failure

Failed examples:

rspec ./spec/acceptance/httpclient/httpclient_spec.rb[1:5:1:6:15:4] # HTTPClient when using async requests with WebMock when request stub declares that request should return a response when sequences of responses are declared should return responses one by one if declared with several to_return invokations

@bblimke
Copy link
Owner

bblimke commented Jul 7, 2017

@lnussbaum thanks. it's a known problem. Have you investigated why this happens?

@lnussbaum
Copy link
Author

I tried but couldn't find anything, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants