Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
compare: retry runset fetch and run upload too
Browse files Browse the repository at this point in the history
  • Loading branch information
lewurm committed Aug 2, 2016
1 parent 1ae46e8 commit ab423e5
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tools/compare/compare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ static async Task<bool> UploadPauseTimes (string binprotFilePath, string grepBin
Value = starts.ToArray ()
});

return await run.UploadForAmend (runId);
for (int i = 0; i < 5; i++) {
if (await run.UploadForAmend (runId))
return true;
Console.Error.WriteLine ("retry run upload: #{0}\n", i);
}
return false;
}

private static Regex JIT_PHASE_REGEX = new Regex ("JIT/(\\w+)\\s*\\(sec\\)\\s*: (\\d+.\\d+)");
Expand Down Expand Up @@ -541,13 +546,18 @@ public static int Main (string[] args)
}
}

RunSet runSet;
RunSet runSet = null;
if (runSetId != null) {
if (pullRequestURL != null) {
Console.Error.WriteLine ("Error: Pull request URL cannot be specified for an existing run set.");
Environment.Exit (1);
}
runSet = AsyncContext.Run (() => RunSet.FromId (machine, runSetId.Value, config, mainCommit, secondaryCommits, buildURL, logURL));
for (var i = 0; i < 5 && runSet == null; i++) {
runSet = AsyncContext.Run(() => RunSet.FromId(machine, runSetId.Value, config, mainCommit, secondaryCommits, buildURL, logURL));
if (runSet == null) {
Console.Error.WriteLine ("retry runset fetch: #{0}", i);
}
}
if (runSet == null) {
Console.Error.WriteLine ("Error: Could not get run set.");
Environment.Exit (1);
Expand Down Expand Up @@ -729,9 +739,9 @@ public static int Main (string[] args)

RunSet.UploadResult uploadResult = null;
for (var i = 0; i < 5 && uploadResult == null; i++) {
uploadResult = AsyncContext.Run(() => runSet.Upload());
uploadResult = AsyncContext.Run (() => runSet.Upload ());
if (uploadResult == null) {
Console.Error.WriteLine("retry upload: #{0}", i);
Console.Error.WriteLine ("retry runset upload: #{0}", i);
}
}
if (uploadResult == null) {
Expand Down

0 comments on commit ab423e5

Please sign in to comment.