Last modified: 2014-10-19 17:43:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72179, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70179 - mediawiki selenium should retry sauce labs requests on timeout
mediawiki selenium should retry sauce labs requests on timeout
Status: NEW
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
wmf-deployment
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-29 16:12 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-10-19 17:43 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2014-08-29 16:12:25 UTC
I finally looked a bit at mediawiki selenium gem code.  I noticed a few jobs failing because of a timeout issue and it ends up being queries done to saucelabs.com

Relevant code:

 lib/mediawiki_selenium/support/env.rb
 
def sauce_api(json)
RestClient::Request.execute(
  :method => :put,
  :url => "https://saucelabs.com/rest/v1/#{ENV['SAUCE_ONDEMAND_USERNAME']}/jobs/#{$session_id}",
  :user => ENV["SAUCE_ONDEMAND_USERNAME"],
  :password => ENV["SAUCE_ONDEMAND_ACCESS_KEY"],
  :headers => {:content_type => "application/json"},
  :payload => json
)
end


Since we often have timeout with sauce labs, I would catch the RestClient::RequestTimeout exception and retry the connection once.

Note RestClient::Request supports different timeout ( https://github.com/rest-client/rest-client/blob/master/lib/restclient/request.rb#L7 ):

:timeout and :open_timeout are how long to wait for a response and to
  #     open a connection, in seconds. Pass nil to disable the timeout.


I am not sure what are the defaults for Net::HTTP.
Comment 1 Antoine "hashar" Musso (WMF) 2014-08-29 20:26:02 UTC
After talking with Chris McMahon, this occurs quite rarely (found 5 such occurrences over the last 10 days). An example build is https://integration.wikimedia.org/ci/job/browsertests-Echo-test2.wikipedia.org-linux-chrome-sauce/9/console



00:13:16.483     When I am on the "Selenium Echo flyout test page" page # features/step_definitions/common_steps.rb:24
00:13:16.483     Then I have no new notifications                       # features/step_definitions/notifications_steps.rb:59
00:13:16.483       Request Timeout (RestClient::RequestTimeout)
00:13:16.483       gems/rest-client-1.7.2/lib/restclient/request.rb:427:in `rescue in transmit'
00:13:16.483       gems/rest-client-1.7.2/lib/restclient/request.rb:350:in `transmit'
00:13:16.483       gems/rest-client-1.7.2/lib/restclient/request.rb:176:in `execute'
00:13:16.483       gems/rest-client-1.7.2/lib/restclient/request.rb:41:in `execute'
00:13:16.483       gems/mediawiki_selenium-0.3.2/lib/mediawiki_selenium/support/env.rb:80:in `sauce_api'
00:13:16.483       gems/mediawiki_selenium-0.3.2/lib/mediawiki_selenium/support/hooks.rb:84:in `block in <top (required)>'


Maybe we can at least yield a better error message, stating that we time-out connecting to SauceLabs? The trace above does not make it obvious.
Comment 2 Chris McMahon 2014-08-29 20:30:58 UTC
This looks like a network failure on our side. 

The test is attempting to retrieve the report information from SauceLabs but there is no connection. 

Just below that the test tries to send an IRC notice but that also fails:


03:19:16 IRC notifier plugin: Sending notification to: #wikimedia-qa
03:19:16 IRC notifier plugin: [ERROR] not connected. Cannot send message to '#wikimedia-qa'

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links