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
c8e8d553
Unverified
Commit
c8e8d553
authored
Jan 25, 2021
by
Jenn Magder
Committed by
GitHub
Jan 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow tests to override _DevFSHttpWriter._startWrite throttle time (#74545)
parent
9baca0c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+8
-1
devfs_test.dart
packages/flutter_tools/test/general.shard/devfs_test.dart
+1
-0
No files found.
packages/flutter_tools/lib/src/devfs.dart
View file @
c8e8d553
...
...
@@ -228,15 +228,18 @@ class _DevFSHttpWriter implements DevFSWriter {
@required
OperatingSystemUtils
osUtils
,
@required
HttpClient
httpClient
,
@required
Logger
logger
,
Duration
uploadRetryThrottle
,
})
:
httpAddress
=
serviceProtocol
.
httpAddress
,
_client
=
httpClient
,
_osUtils
=
osUtils
,
_uploadRetryThrottle
=
uploadRetryThrottle
,
_logger
=
logger
;
final
HttpClient
_client
;
final
OperatingSystemUtils
_osUtils
;
final
Logger
_logger
;
final
Duration
_uploadRetryThrottle
;
final
String
fsName
;
final
Uri
httpAddress
;
...
...
@@ -320,7 +323,7 @@ class _DevFSHttpWriter implements DevFSWriter {
if
(
retry
>
0
)
{
retry
--;
_logger
.
printTrace
(
'trying again in a few -
$retry
more attempts left'
);
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
500
));
await
Future
<
void
>.
delayed
(
_uploadRetryThrottle
??
const
Duration
(
milliseconds:
500
));
continue
;
}
_completer
.
completeError
(
error
,
trace
);
...
...
@@ -364,6 +367,8 @@ class UpdateFSReport {
class
DevFS
{
/// Create a [DevFS] named [fsName] for the local files in [rootDirectory].
///
/// Failed uploads are retried after [uploadRetryThrottle] duration, defaults to 500ms.
DevFS
(
vm_service
.
VmService
serviceProtocol
,
this
.
fsName
,
...
...
@@ -372,6 +377,7 @@ class DevFS {
@required
Logger
logger
,
@required
FileSystem
fileSystem
,
HttpClient
httpClient
,
Duration
uploadRetryThrottle
,
})
:
_vmService
=
serviceProtocol
,
_logger
=
logger
,
_fileSystem
=
fileSystem
,
...
...
@@ -380,6 +386,7 @@ class DevFS {
serviceProtocol
,
osUtils:
osUtils
,
logger:
logger
,
uploadRetryThrottle:
uploadRetryThrottle
,
httpClient:
httpClient
??
((
context
.
get
<
HttpClientFactory
>()
==
null
)
?
HttpClient
()
:
context
.
get
<
HttpClientFactory
>()())
...
...
packages/flutter_tools/test/general.shard/devfs_test.dart
View file @
c8e8d553
...
...
@@ -219,6 +219,7 @@ void main() {
fileSystem:
fileSystem
,
logger:
BufferLogger
.
test
(),
httpClient:
httpClient
,
uploadRetryThrottle:
Duration
.
zero
,
);
await
devFS
.
create
();
...
...
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