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

Unified Diff: tools/testing/dart/browser_controller.dart

Issue 107513004: Test infrastructure: add retry to browser controller sending "done" message. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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: tools/testing/dart/browser_controller.dart
diff --git a/tools/testing/dart/browser_controller.dart b/tools/testing/dart/browser_controller.dart
index 501f76520912b55896e623efdd84aeca6f49cb7e..b25c992766f4986aa7b7318d7d208d1bb0281f4f 100644
--- a/tools/testing/dart/browser_controller.dart
+++ b/tools/testing/dart/browser_controller.dart
@@ -1273,7 +1273,7 @@ class BrowserTestingServer {
// Until we have the next task we set the current_id to a specific
// negative value.
contactBrowserController(
- 'GET', '$nextTestPath/$browserId', newTaskHandler, "", false);
+ 'GET', '$nextTestPath/$browserId', newTaskHandler, "", false);
}
function run(url) {
@@ -1308,7 +1308,7 @@ class BrowserTestingServer {
}
}
contactBrowserController(
- 'POST', '$errorReportingUrl?test=1', handleReady, msg, true);
+ 'POST', '$errorReportingUrl?test=1', handleReady, msg, true);
}
function reportMessage(msg, isFirstMessage, isStatusUpdate) {
@@ -1324,8 +1324,15 @@ class BrowserTestingServer {
function() {}, msg, true);
} else {
var is_double_report = test_completed;
+ var retry = 0;
test_completed = true;
+ function reportDoneMessage() {
+ contactBrowserController(
+ 'POST', '$reportPath/${browserId}?id=' + current_id,
+ handleReady, msg, true);
+ }
+
function handleReady() {
if (this.readyState == this.DONE) {
if (this.status == 200) {
@@ -1333,13 +1340,17 @@ class BrowserTestingServer {
getNextTask();
}
} else {
- reportError('Error sending result to server');
+ reportError('Error sending result to server. Status: ' +
+ this.status + ' Retry: ' + retry);
kustermann 2013/12/06 14:42:58 Could you test if this 'reportError()' functionali
+ retry++;
+ if (retry < 3) {
+ setTimeout(reportDoneMessage, 1000);
+ }
}
}
}
- contactBrowserController(
- 'POST', '$reportPath/${browserId}?id=' + current_id, handleReady,
- msg, true);
+
+ reportDoneMessage();
}
}
@@ -1354,7 +1365,7 @@ class BrowserTestingServer {
function messageHandler(e) {
var msg = e.data;
if (typeof msg != 'string') return;
-
+
var parsedData = parseResult(msg);
if (parsedData) {
// Only if the JSON was valid, we'll post it back.
« 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