Commit 73e83f95 authored by Ned Nguyen's avatar Ned Nguyen Committed by Commit Bot

[perf] Do not specify timeout limit for luci-auth's token generation

We misunderstood how authentication token works in the past. For one time request,
the token expiration time don't matter much.

Setting a high timeout expiration is making luci-auth fail flakily. Since we
generate a new token for every perf dashboard upload attempt, using the default
value of luci-auth should be fine

Bug:878916
Cq-Include-Trybots: master.tryserver.chromium.perf:obbs_fyi
Change-Id: Ie9025fb0fc2467dda02cd8aa0aa3e2136ca190a8

NOTRY=true # all tests passed, speed up landing to green up perf waterfall uploading

Change-Id: Ie9025fb0fc2467dda02cd8aa0aa3e2136ca190a8
Reviewed-on: https://chromium-review.googlesource.com/1195930
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Reviewed-by: default avatarSimon Hatch <simonhatch@chromium.org>
Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Reviewed-by: default avatarAndrii Shyshkalov <tandrii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587352}
parent 750635ec
......@@ -34,7 +34,6 @@ psutil = external_modules.ImportOptionalModule('psutil')
# The paths in the results dashboard URLs for sending results.
SEND_RESULTS_PATH = '/add_point'
SEND_HISTOGRAMS_PATH = '/add_histograms'
DEFAULT_TOKEN_TIMEOUT_IN_MINUTES = 30
class SendResultException(Exception):
......@@ -49,10 +48,8 @@ class SendResultsFatalException(SendResultException):
pass
def LuciAuthTokenGeneratorCallback(
service_account_file, token_expiration_in_minutes):
args = ['luci-auth', 'token',
'-lifetime', '%im' % token_expiration_in_minutes]
def LuciAuthTokenGeneratorCallback(service_account_file):
args = ['luci-auth', 'token']
if service_account_file:
args += ['-service-account-json', service_account_file]
else:
......@@ -87,8 +84,7 @@ def SendResults(data, data_label, url, send_as_histograms=False,
builder will be used.
token_generator_callback: a callback for generating the authentication token
to upload to perf dashboard.
This callback takes two parameters
(service_account_file, token_expiration_in_minutes) and returns the token
This callback takes |service_account_file| and returns the token
string.
If |token_generator_callback| is not specified, it's default to
LuciAuthTokenGeneratorCallback.
......@@ -470,8 +466,7 @@ def _SendHistogramJson(url, histogramset_json,
None if successful, or an error string if there were errors.
"""
try:
oauth_token = token_generator_callback(
service_account_file, DEFAULT_TOKEN_TIMEOUT_IN_MINUTES)
oauth_token = token_generator_callback(service_account_file)
data = zlib.compress(histogramset_json)
headers = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment