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

Side by Side Diff: tools/gardening/lib/src/buildbot_loading.dart

Issue 2998993002: Use timeout to read most recent build from http (Closed)
Patch Set: Updated cf. comments Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « tools/gardening/bin/current_summary.dart ('k') | tools/gardening/lib/src/client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 import 'util.dart'; 7 import 'util.dart';
8 8
9 import 'buildbot_structures.dart'; 9 import 'buildbot_structures.dart';
10 import 'cache.dart'; 10 import 'cache.dart';
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 return result; 27 return result;
28 } else { 28 } else {
29 return parseTestStepResult( 29 return parseTestStepResult(
30 buildUri, await cache.read(buildUri.logdogPath, read)); 30 buildUri, await cache.read(buildUri.logdogPath, read));
31 } 31 }
32 } 32 }
33 33
34 /// Fetches test data for [buildUri] through the buildbot stdio. 34 /// Fetches test data for [buildUri] through the buildbot stdio.
35 Future<BuildResult> readBuildResultFromHttp( 35 Future<BuildResult> readBuildResultFromHttp(
36 HttpClient client, BuildUri buildUri) { 36 HttpClient client, BuildUri buildUri,
37 [Duration timeout]) {
37 Future<String> read() async { 38 Future<String> read() async {
38 Uri uri = buildUri.toUri(); 39 Uri uri = buildUri.toUri();
39 log('Reading buildbot results: $uri'); 40 log('Reading buildbot results: $uri');
40 return readUriAsText(client, uri); 41 return readUriAsText(client, uri, timeout);
41 } 42 }
42 43
43 return _readBuildResult(buildUri, read); 44 return _readBuildResult(buildUri, read);
44 } 45 }
45 46
46 /// Fetches test data for [buildUri] through logdog. 47 /// Fetches test data for [buildUri] through logdog.
47 /// 48 ///
48 /// The build number of [buildUri] most be non-negative. 49 /// The build number of [buildUri] most be non-negative.
49 Future<BuildResult> readBuildResultFromLogDog(BuildUri buildUri) { 50 Future<BuildResult> readBuildResultFromLogDog(BuildUri buildUri) {
50 Future<String> read() async { 51 Future<String> read() async {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 String archName = name.substring(0, slashPos); 139 String archName = name.substring(0, slashPos);
139 String testName = name.substring(slashPos + 1); 140 String testName = name.substring(slashPos + 1);
140 timings.add(new Timing( 141 timings.add(new Timing(
141 uri, 142 uri,
142 time, 143 time,
143 new TestStep( 144 new TestStep(
144 stepName, new TestConfiguration(configName, archName, testName)))); 145 stepName, new TestConfiguration(configName, archName, testName))));
145 } 146 }
146 return timings; 147 return timings;
147 } 148 }
OLDNEW
« no previous file with comments | « tools/gardening/bin/current_summary.dart ('k') | tools/gardening/lib/src/client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698