https://bugzilla.wikimedia.org/show_bug.cgi?id=72056

            Bug ID: 72056
           Summary: QA: mediawiki_api doesn't report HTTP errors
           Product: Wikimedia
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Quality Assurance
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
       Web browser: ---
   Mobile Platform: ---

An Echo browser test trying to create an account failed with 503 Service
unavailable. That's understandable, but the indication of failure was buried in
the HTML of the WMF error page.

It would be great if the mediawiki_api gem noticed the HTTP request error
status and failed with e.g. "create_account API HTTP request failure: <Status
line>"

I'm confused because gerrit 157300 fixed bug 70193 "Client now throws an
HttpError when handling HTTP responses", but the check
   raise HttpError, response.status if response.status >= 400
seems missing from mediawiki_api-0.2.1 in this CI run and my local .rvm gem.

The failure was in
<https://integration.wikimedia.org/ci/job/browsertests-Echo-en.wikipedia.beta.wmflabs.org-linux-chrome-sauce/105/consoleFull>
The line that went wrong is:

    on(APIPage).client.create_account(username, ENV["MEDIAWIKI_PASSWORD"])

The console output is

...
05:35:08     Given I am logged in as a new user                    #
features/step_definitions/notifications_steps.rb:60
05:35:08       757: unexpected token at '<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd";>
... entire text of the HTML error page
... 100s of lines later:
05:35:09          <!-- Technical details of the error; shows all the time, with
any language -->
05:35:09          <div class="TechnicalStuff">
05:35:09           <bdo dir="ltr">
05:35:09               503 Service Temporarily Unavailable
05:35:09           </bdo>
05:35:09           <div id="AdditionalTechnicalStuff"></div>
05:35:09          </div>
... 100s more lines
05:35:09       </html>
05:35:09     
05:35:09       ' (JSON::ParserError)

05:35:09      
/mnt/jenkins-workspace/workspace/gems/gems/json-1.8.1/lib/json/common.rb:155:in
`parse'
05:35:09      
/mnt/jenkins-workspace/workspace/gems/gems/json-1.8.1/lib/json/common.rb:155:in
`parse'
05:35:09      
/mnt/jenkins-workspace/workspace/gems/gems/mediawiki_api-0.2.1/lib/mediawiki_api/response.rb:85:in
`response_object'
05:35:09      
/mnt/jenkins-workspace/workspace/gems/gems/mediawiki_api-0.2.1/lib/mediawiki_api/response.rb:46:in
`data'
05:35:09      
/mnt/jenkins-workspace/workspace/gems/gems/mediawiki_api-0.2.1/lib/mediawiki_api/client.rb:51:in
`create_account'
05:35:09      
/mnt/jenkins-workspace/workspace/gems/gems/mediawiki_api-0.2.1/lib/mediawiki_api/client.rb:58:in
`create_account'
05:35:09      
/mnt/jenkins-workspace/workspace/browsertests-Echo-en.wikipedia.beta.wmflabs.org-linux-chrome-sauce/tests/browser/features/step_definitions/common_steps.rb:48:in
`block in <top (required)>'

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to