Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
febce13a
Unverified
Commit
febce13a
authored
Jun 04, 2021
by
Dan Field
Committed by
GitHub
Jun 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make retry logic more permissive for network errors (#83965)
parent
2d8d1052
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
gradle_errors.dart
packages/flutter_tools/lib/src/android/gradle_errors.dart
+3
-3
gradle_errors_test.dart
..._tools/test/general.shard/android/gradle_errors_test.dart
+32
-0
No files found.
packages/flutter_tools/lib/src/android/gradle_errors.dart
View file @
febce13a
...
...
@@ -50,8 +50,8 @@ enum GradleBuildStatus {
retryWithAarPlugins
,
}
/// Returns a simple test function that evaluates to
[true] i
f
///
[errorMessage]
is contained in the error message.
/// Returns a simple test function that evaluates to
`true` if at least one o
f
///
`errorMessages`
is contained in the error message.
GradleErrorTest
_lineMatcher
(
List
<
String
>
errorMessages
)
{
return
(
String
line
)
{
return
errorMessages
.
any
((
String
errorMessage
)
=>
line
.
contains
(
errorMessage
));
...
...
@@ -118,7 +118,7 @@ final GradleHandledError networkErrorHandler = GradleHandledError(
'javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake'
,
'java.net.SocketException: Connection reset'
,
'java.io.FileNotFoundException'
,
'Gateway Time-out'
"> Could not get resource 'http"
,
]),
handler:
({
required
String
line
,
...
...
packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart
View file @
febce13a
...
...
@@ -298,6 +298,38 @@ A problem occurred configuring root project 'android'.
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('
retries
if
Gradle
could
not
get
a
resource
(
non
-
Gateway
)
', () async {
const String errorMessage = '''
*
Error
running
Gradle:
Exit
code
1
from:
/
home
/
travis
/
build
/
flutter
/
flutter
sdk
/
examples
/
flutter_gallery
/
android
/
gradlew
app:properties:
Starting
a
Gradle
Daemon
(
subsequent
builds
will
be
faster
)
Picked
up
_JAVA_OPTIONS:
-
Xmx2048m
-
Xms512m
FAILURE:
Build
failed
with
an
exception
.
*
What
went
wrong:
A
problem
occurred
configuring
root
project
'android'
.
>
Could
not
resolve
all
files
for
configuration
':classpath'
.
>
Could
not
resolve
com
.
android
.
tools
.
build
:
gradle:
3.1
.
2
.
Required
by:
project
:
>
Could
not
resolve
com
.
android
.
tools
.
build
:
gradle:
3.1
.
2
.
>
Could
not
get
resource
'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom'
.
>
Could
not
GET
'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom'
.
>
Remote
host
closed
connection
during
handshake
''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'
Gradle
threw
an
error
while
downloading
artifacts
from
the
network
.
'
'
Retrying
to
download
...
'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
});
});
group('
permission
errors
', () {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment