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

Unified Diff: dashboard/dashboard/pinpoint/models/quest/find_isolate.py

Issue 3010873003: [pinpoint] Limit executions to one test run each + device sharding. (Closed)
Patch Set: Ready! Created 3 years, 3 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
Index: dashboard/dashboard/pinpoint/models/quest/find_isolate.py
diff --git a/dashboard/dashboard/pinpoint/models/quest/find_isolate.py b/dashboard/dashboard/pinpoint/models/quest/find_isolate.py
index 636555d907e6fb5f42c48158aa1f2d3d75de27a0..ef1a0e4254500bbf0c42454353a43fc5d77c42d2 100644
--- a/dashboard/dashboard/pinpoint/models/quest/find_isolate.py
+++ b/dashboard/dashboard/pinpoint/models/quest/find_isolate.py
@@ -34,6 +34,8 @@ class FindIsolate(quest.Quest):
class _FindIsolateExecution(execution.Execution):
+ _previous_builds = {}
+
def __init__(self, builder_name, target, change):
super(_FindIsolateExecution, self).__init__()
self._builder_name = builder_name
@@ -78,8 +80,14 @@ class _FindIsolateExecution(execution.Execution):
raise BuildError('Buildbucket says the build completed successfully, '
"but Pinpoint can't find the isolate hash.")
- # Request a build!
- self._build = _RequestBuild(self._builder_name, self._change)['build']['id']
+ if self._change in self._previous_builds:
+ # If another Execution already requested a build, reuse that one.
+ self._build = self._previous_builds[self._change]
+ else:
+ # Request a build!
+ buildbucket_info = _RequestBuild(self._builder_name, self._change)
+ self._build = buildbucket_info['build']['id']
+ self._previous_builds[self._change] = self._build
def _BuilderNameForConfiguration(configuration):

Powered by Google App Engine
This is Rietveld 408576698