Closed Bug 1616689 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 21889 - Detect WebKitGTK crashes and WebDriver hangs

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox75 fixed)

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 21889 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/21889
Details from upstream follow.

Carlos Alberto Lopez Perez <clopez@igalia.com> wrote:

Detect WebKitGTK crashes and WebDriver hangs

This PR allows WPT to detect when WebKitGTK crashes (and maybe Safari also).
It also improves detecting hangs of WebDriver, that now should be reported as crashes as it seems it was intended on the current code (but not working)

This PR contains 2 commits, description below:

  • Commit 1
 Avoid raising httplib.CannotSendRequest exception if the WebDriver hangs.
    
    * When the WebDriver hangs the httplib request will not return until the
    HTTP timeout triggers, but we were using the default HTTP timeout which
    is much bigger than the test timeout since 2cc0e750cb.
    
    * Then when the external timeout triggers, the next request to the
    WebDriver will cause an httplib.CannotSendRequest exception because
    we didn't waited for the httplib request.
    
    * To fix that we set a boolean and restart the connection with the
    WebDriver if the previous one didn't finished.
    
    * This patch also removes the timeout setting from the class
    HTTPWireProtocol() which was unused (it passed a value of None
    always)
  • Commit 2
    Improve detection of crashes and hangs with WebDriver.
    
    This makes crash report work with WebKitWebDriver:
     * When the WebKitWebProcess crashes, WebKitWebDriver will raise an
       InvalidSessionIdException <https://webkit.org/b/207565> like the
       Chrome WebDriver does. So we make WebDriverProtocol::is_alive()
       check for that exception.
    
    It also fixes detecting when the WebDriver has hanged:
     * The call to is_alive() can hang if WebDriver itself has hanged
       or its unresponsive. If this call takes more than 5 seconds then
       the external timeout from the testrunner will be fired and testrunner
       will force a termination of the test marking it as external-timeout
       instead of crash.
     * The current logic tried to mark the test as crashing if socket
       timeout fired, but that timeout value was much higher than the
       grace period of 5 seconds, so this didn't worked.
     * We modify the socket timeout to 2 seconds, which should be more
       than enough to check if the WebDriver its still alive and allows
       to complete the check during the testrunner 5 seconds of
       extra_timeout.
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c6f87f0edd8d [wpt PR 21889] - Detect WebKitGTK crashes and WebDriver hangs, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.