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

Unified Diff: dashboard/dashboard/pinpoint/models/quest/find_isolate_test.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_test.py
diff --git a/dashboard/dashboard/pinpoint/models/quest/find_isolate_test.py b/dashboard/dashboard/pinpoint/models/quest/find_isolate_test.py
index 8732a0df36ed95ccae64cbb1c8fd1b8d7f3b710d..37132a997d8fc3dbf2ce6b06273904a5e4895307 100644
--- a/dashboard/dashboard/pinpoint/models/quest/find_isolate_test.py
+++ b/dashboard/dashboard/pinpoint/models/quest/find_isolate_test.py
@@ -153,6 +153,41 @@ class BuildTest(_FindIsolateTest):
self.assertExecutionSuccess(execution)
+ def testSimultaneousBuilds(self, put, get_job_status):
+ # Two builds started at the same time on the same Change should reuse the
+ # same build request.
+ change = change_module.Change(change_module.Dep('src', 'base git hash'))
+ quest = find_isolate.FindIsolate('Mac Pro Perf', 'telemetry_perf_tests')
+ execution_1 = quest.Start(change)
+ execution_2 = quest.Start(change)
+
+ # Request a build.
+ put.return_value = {'build': {'id': 'build_id'}}
+ execution_1.Poll()
+ execution_2.Poll()
+
+ self.assertFalse(execution_1.completed)
+ self.assertFalse(execution_2.completed)
+ self.assertEqual(put.call_count, 1)
+
+ # Check build status.
+ get_job_status.return_value = {'build': {'status': 'STARTED'}}
+ execution_1.Poll()
+ execution_2.Poll()
+
+ self.assertFalse(execution_1.completed)
+ self.assertFalse(execution_2.completed)
+ self.assertEqual(get_job_status.call_count, 2)
+
+ # Look up isolate hash.
+ isolate.Put((('Mac Builder', change,
+ 'telemetry_perf_tests', 'isolate git hash'),))
+ execution_1.Poll()
+ execution_2.Poll()
+
+ self.assertExecutionSuccess(execution_1)
+ self.assertExecutionSuccess(execution_2)
+
def testBuildFailure(self, put, get_job_status):
change = change_module.Change(
change_module.Dep('src', 'base git hash'),

Powered by Google App Engine
This is Rietveld 408576698