wpt: Limit the console output sent to the intermittent tracker (#31895)

This is a speculative fix for #31845. Instead of sending all of the
output to the dashboard, send just the first 1024 characters. This value
can be adjusted in the future if it is too large or too small.

Fixes #31845.
This commit is contained in:
Martin Robinson 2024-03-27 15:55:00 +01:00 committed by GitHub
parent bb7778774d
commit 65db6e3b08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,6 +31,7 @@ CERTS_PATH = os.path.join(WPT_TOOLS_PATH, "certs")
TRACKER_API = "https://build.servo.org/intermittent-tracker"
TRACKER_API_ENV_VAR = "INTERMITTENT_TRACKER_API"
TRACKER_DASHBOARD_SECRET_ENV_VAR = "INTERMITTENT_TRACKER_DASHBOARD_SECRET"
TRACKER_DASHBOARD_MAXIMUM_OUTPUT_LENGTH = 1024
def set_if_none(args: dict, key: str, value):
@ -235,7 +236,10 @@ class TrackerDashboardFilter():
'expected': result.expected,
'actual': result.actual,
'time': result.time // 1000,
'message': result.message,
# Truncate the message, to avoid issues with lots of output causing "HTTP
# Error 413: Request Entity Too Large."
# See https://github.com/servo/servo/issues/31845.
'message': result.message[0:TRACKER_DASHBOARD_MAXIMUM_OUTPUT_LENGTH],
'stack': result.stack,
}
if isinstance(result, UnexpectedSubtestResult):