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
913d5933
Unverified
Commit
913d5933
authored
Jan 20, 2021
by
Ben Konyi
Committed by
GitHub
Jan 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check VM service URI is valid before attempting to start DDS (Re-upload #73998) (#74280)
parent
024c49da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+14
-0
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+10
-0
No files found.
packages/flutter_tools/lib/src/resident_runner.dart
View file @
913d5933
...
...
@@ -242,6 +242,20 @@ class FlutterDevice {
completer
.
completeError
(
'failed to connect to
$observatoryUri
'
,
st
);
}
}
// First check if the VM service is actually listening on observatoryUri as
// this may not be the case when scraping logcat for URIs. If this URI is
// from an old application instance, we shouldn't try and start DDS.
try
{
service
=
await
connectToVmService
(
observatoryUri
);
service
.
dispose
();
}
on
Exception
catch
(
exception
)
{
globals
.
printTrace
(
'Fail to connect to service protocol:
$observatoryUri
:
$exception
'
);
if
(!
completer
.
isCompleted
&&
!
_isListeningForObservatoryUri
)
{
completer
.
completeError
(
'failed to connect to
$observatoryUri
'
);
}
return
;
}
// This first try block is meant to catch errors that occur during DDS startup
// (e.g., failure to bind to a port, failure to connect to the VM service,
// attaching to a VM service with existing clients, etc.).
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
913d5933
...
...
@@ -2889,6 +2889,16 @@ void main() {
if
(!
caught
)
{
fail
(
'Expected a StateError to be thrown.'
);
}
},
overrides:
<
Type
,
Generator
>{
VMServiceConnector:
()
=>
(
Uri
httpUri
,
{
ReloadSources
reloadSources
,
Restart
restart
,
CompileExpression
compileExpression
,
GetSkSLMethod
getSkSLMethod
,
PrintStructuredErrorLogMethod
printStructuredErrorLogMethod
,
io
.
CompressionOptions
compression
,
Device
device
,
})
async
=>
mockVMService
,
}));
testUsingContext
(
'nextPlatform moves through expected platforms'
,
()
{
...
...
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