[flutter_tool] Retry a gradle build on connection timeout (#143084)

This PR will likely not help with the issue on our CI discussed in
https://github.com/flutter/flutter/issues/142637, but will do one retry
for our users if they hit the same issue.
This commit is contained in:
Zachary Anderson
2024-02-08 12:39:00 -08:00
committed by GitHub
parent cc4abe92fb
commit fbc9f2d5bf
2 changed files with 39 additions and 4 deletions

View File

@@ -112,15 +112,16 @@ final GradleHandledError permissionDeniedErrorHandler = GradleHandledError(
@visibleForTesting
final GradleHandledError networkErrorHandler = GradleHandledError(
test: _lineMatcher(const <String>[
"> Could not get resource 'http",
'java.io.FileNotFoundException',
'java.io.FileNotFoundException: https://downloads.gradle.org',
'java.io.IOException: Unable to tunnel through proxy',
'java.io.IOException: Server returned HTTP response code: 502',
'java.io.IOException: Unable to tunnel through proxy',
'java.lang.RuntimeException: Timeout of',
'java.net.ConnectException: Connection timed out',
'java.net.SocketException: Connection reset',
'java.util.zip.ZipException: error in opening zip file',
'javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake',
'java.net.SocketException: Connection reset',
'java.io.FileNotFoundException',
"> Could not get resource 'http",
]),
handler: ({
required String line,