Comments (22)
same on my side but with a timeout::Error ;(
execution expired (Timeout::Error)
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/timeout.rb:64:in `rbuf_fill'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:126:in `readline'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:2028:in `read_status_line'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:2017:in `read_new'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1051:in `request_without_fakeweb'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1037:in `request_without_fakeweb'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:543:in `start'
/Users/james/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1035:in `request_without_fakeweb'
./features/step_definitions/web_steps.rb:42
./features/step_definitions/web_steps.rb:15:in `with_scope'
./features/step_definitions/web_steps.rb:41:in `/^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")?$/'
from fakeweb.
Somehow, Artifice does the job of removing itself when deactivated much better. As cool as Artifice is, it's a bit outdated compared to FakeWeb or WebMock, and it would be nice to have the option to switch, at least.
I wonder if it's possible to do like Artifice does and save the original version of Net::HTTP in a constant and simply swap it in when FakeWeb is deactivated.
from fakeweb.
+1 on the timeout issue, mine is with capybara and selenium.. seems to be random.
from fakeweb.
+1 for the Timeout::Error (capybara & selenium)
from fakeweb.
+1
I get the Timeout::Error too
capybara 1.0.0
fakeweb 1.3.0
cucumber-rails 1.0.2
from fakeweb.
Ditto, I'm seeing the same behavior. FWIW, I can specify :require => false on fakeweb in Bundler and then the problem goes away.
from fakeweb.
I guess the whole point for us was to make sure our cucumber scenarios didn't hit outside sources, so even when I added :require => false, I'd still have to include it somewhere in order to block external calls. And we even tried only enabling it for non @javascript cukes, but just the same, I think it messed with Net::HTTP enough to make the selenium tests hang indefinitely.
from fakeweb.
I actually want my cucumber scenarios to hit outside resources, which is why my solution worked for me. :-)
from fakeweb.
Fair enough :)
from fakeweb.
Yup facing the same problem, it tooks me 3 hour that the error related to fake web -_-
from fakeweb.
+1
from fakeweb.
+1
from fakeweb.
http://ahmy.yulrizka.com/2011/08/cucumber-timeouterror-timeouterror-on-fakeweb/
The sollution for me is add :require => false to the Gemfile
gem 'fakeweb', :require => false
and only require fakeweb on rspec by including it on spec/spec_helper.rb
require 'fakeweb'
from fakeweb.
Yeah, I think that's what most of us have done so far, but the whole point was to not let cucumber hit outside sources.
See my earlier comment here.
from fakeweb.
Interestingly enough, on that link you posted, a commenter said this:
There is a problem with Fakeweb which breaks normal Net::HTTP behaviour and leads to this Timeout::Error. I had the same problem in WebMock (since WebMock Net::HTTP adapter is based on Fakeweb) but it's now fixed in the new WebMock 1.7.0.
If that's the case, I'll probably use WebMock. But it would be cool if FakeWeb could adopt the changes which fixed that. (If it really is fixed for WebMock, that is.)
from fakeweb.
@sfsekaran I switched to webmock and work fine.
from fakeweb.
Good to know, thanks!
from fakeweb.
This is a big issue. Is the recommendation just to switch to WebMock, or will this be fixed at some point?
from fakeweb.
+1
from fakeweb.
I found a decent solution was to allow Selenium requests in all specs:
selenium_requests = %r{/((__.+__)|(hub/session.*))$}
FakeWeb.allow_net_connect = selenium_requests
It's unlikely that other requests would match that expression, but you might be able to make it more restrictive if you were to find such a beast.
from fakeweb.
/cc @jsanders
from fakeweb.
The selenium requests solution by @jamesarosen didn't work for me. Switched to webmock and everything is great. I only need it for VCR anyhow, so it was no hassle.
from fakeweb.
Related Issues (20)
- 1.3.0 does not recognize registered uri for post method
- Assigned but unused variable - uri in lib/fake_web/utility.rb:35
- using an https url HOT 2
- FakeWeb doesn't mimic Net::HTTP's check "#read_body called twice (IOError)"
- Different Responses to the same URI based on the passed data HOT 2
- "FakeWeb.allow_net_connect = true" doesn't work with PORO/ElasticSearch
- FakeWeb doesn't match non alphabetized query strings
- consider switching to Mocha 1.0 HOT 1
- please tag a new version and release a new gem HOT 4
- Unregister single URIs
- NetConnectNotAllowedError reports the URI different than what is acually being matched. HOT 3
- FakeWeb post method and check the request.body
- Too many connections error
- Release is desperately needed HOT 19
- Make it easier to access submitted data HOT 1
- Compatibility Issue with Ruby 2.4? HOT 2
- Test failures? HOT 4
- Regexp with query params fail without trailing slash after host
- Ruby 2 stops receiving security updates at the end of March
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fakeweb.