Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: third_party/WebKit/Tools/Scripts/print-stale-test-expectations-entries

Issue 2131463005: In print-stale-test-expectations-entries, avoid repeating the same request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/print-stale-test-expectations-entries
diff --git a/third_party/WebKit/Tools/Scripts/print-stale-test-expectations-entries b/third_party/WebKit/Tools/Scripts/print-stale-test-expectations-entries
index 0ae5d9cb4a4e0da79804f66641d33da4269dbe57..20c76099660c970c915ee6b8a074f11487a1dc51 100755
--- a/third_party/WebKit/Tools/Scripts/print-stale-test-expectations-entries
+++ b/third_party/WebKit/Tools/Scripts/print-stale-test-expectations-entries
@@ -52,8 +52,13 @@ class StaleTestPrinter(object):
def __init__(self, options):
self.days = options.days
self.create_csv = options.create_csv
+ self.is_stale_results = {}
def is_stale(self, bug_link):
+ if bug_link in self.is_stale_results:
+ return self.is_stale_results[bug_link]
+ # In case there's an error in the request, don't make the same request again.
+ self.is_stale_results[bug_link] = False
bug_number = bug_link.strip(crbug_prefix)
url = google_code_url % bug_number
response = urllib2.urlopen(url)
@@ -61,7 +66,8 @@ class StaleTestPrinter(object):
last_updated = parsed['updated']
parsed_time = datetime.datetime.strptime(last_updated.split(".")[0] + "UTC", "%Y-%m-%dT%H:%M:%S%Z")
time_delta = datetime.datetime.now() - parsed_time
- return time_delta.days > self.days
+ self.is_stale_results[bug_link] = time_delta.days > self.days
+ return self.is_stale_results[bug_link]
def print_stale_tests(self):
host = Host()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698