← Back to Upcase

Twitter.search Execution expired


(Richard Wigley) #1

I was getting intermittent bug (see below) - especially the first time I ran the spec after a few minutes break. If anyone else is seeing this bug you might want to consider this solution.

Failure/Error: click_on 'Search'
     Twitter::Error::ClientError:
       execution expired

Basically, with scientific like precision, I doubled the timeout configuration and it works each time now. Configuration information came from github link by the main developer of Twitter gem.

hashtag/config/initializers/twitter.rb


Twitter.configure do |config|

  # open_timeout is the maximum mount of time that the HTTP adapter will wait to
  # open a connection to the server.
  # Once the connection is established it has timeout seconds to respond.
  # the &gt things are of course > but you're against the limitation of my markup now ;-)
  config.connection_options = Twitter::Default::CONNECTION_OPTIONS.merge(:request => {
    :open_timeout => 10,
    :timeout => 20
  })
end

If anyone has a better solution, or clearer understanding, I would be very interested - however, this allows me to continue the TDD workshop.