Bug 1830544 [wpt PR 39708] - Allow suppressing tracebacks from handler exceptions...
commit1b5755d5a3527fa67baea096c7ba319ccf597cce
authorJames Graham <james@hoppipolla.co.uk>
Wed, 17 May 2023 13:01:25 +0000 (17 13:01 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sun, 21 May 2023 22:43:27 +0000 (21 22:43 +0000)
tree366cf757b024317a5f3368f58602cde8aad537e3
parentc187591eb294d87915650731dd7eccae12bb26c4
Bug 1830544 [wpt PR 39708] - Allow suppressing tracebacks from handler exceptions, a=testonly

Automatic update from web-platform-tests
Allow suppressing tracebacks for handler errors

When a wptserve HTTP handler throws an exception, wptserve by default
logs the traceback to stdout. This is a bit of a pain Gecko's CI
because we spot the traceback and add it to the log summary, which
causes people to believe that the errors they're seeing are important
to test failures, when _usually_ they're coming from unrelated tests.

However suppressing these errors entirely is unhelpful when trying to
disgnose the server error itself.

To solve this we add a command line flag to wptrunner:
--suppress-handler-traceback that will be set in Gecko CI but not
elsewhere. This causes a brief error message to be logged, but not the
full traceback.

On the wptserve side, this is represented as a config option
logging.suppress_handler_traceback. For neatness, the existing
log_level option was moved under a logging sub-object.

In addition, for the default case we clean up the traceback a bit, so
that we get the traceback generated from the user code and omit the
traceback resulting from it being re-thrown as a HTTPException.

Differential Revision: https://phabricator.services.mozilla.com/D176169

--
Improve error reporting from stash

Differential Revision: https://phabricator.services.mozilla.com/D176170

--
Fix pipe name in anonymous-iframe test

Differential Revision: https://phabricator.services.mozilla.com/D176171

--
Allow setting cookie value in CSP support file

Some tests were assuming the value parameter could be used to set a stash key.

Differential Revision: https://phabricator.services.mozilla.com/D176172

--
Log a warning if the client closed the connection during h2 setup

Differential Revision: https://phabricator.services.mozilla.com/D176173

--
Fix __getattr__ on config
--

wpt-commits: 080b865ef9e42c5ce85ab355586c2d087a1bf0155cda966d4ad6ebe53be4b206853a06ecba9185ff611d7c7132cc6abf0677deab2da5750756adeb666e091cfc51dd2c13fe8f23485549e3d0e59c5c49dfdb96b9d2288615e893f0f49942f2398d0b1ca0aa70b5074cad44e057e0059473e7653b92c8a3dd
wpt-pr: 39708
14 files changed:
testing/web-platform/tests/content-security-policy/reporting/support/set-cookie.py
testing/web-platform/tests/html/anonymous-iframe/embedding.tentative.https.window.js
testing/web-platform/tests/resource-timing/resources/fake_responses.py
testing/web-platform/tests/tools/serve/serve.py
testing/web-platform/tests/tools/wptrunner/wptrunner/environment.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
testing/web-platform/tests/tools/wptserve/tests/functional/test_response.py
testing/web-platform/tests/tools/wptserve/wptserve/config.py
testing/web-platform/tests/tools/wptserve/wptserve/handlers.py
testing/web-platform/tests/tools/wptserve/wptserve/response.py
testing/web-platform/tests/tools/wptserve/wptserve/server.py
testing/web-platform/tests/tools/wptserve/wptserve/stash.py
testing/web-platform/tests/tools/wptserve/wptserve/utils.py