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
0889e143
Unverified
Commit
0889e143
authored
Apr 29, 2020
by
Jonah Williams
Committed by
GitHub
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] increase stopApp timeout for FlutterDevice.exitApps (#55984)
parent
1e150c5d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
7 deletions
+54
-7
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+8
-7
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+1
-0
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+45
-0
No files found.
packages/flutter_tools/lib/src/resident_runner.dart
View file @
0889e143
...
...
@@ -251,14 +251,15 @@ class FlutterDevice {
return
_views
;
}
Future
<
void
>
exitApps
()
async
{
Future
<
void
>
exitApps
({
@visibleForTesting
Duration
timeoutDelay
=
const
Duration
(
seconds:
10
),
})
async
{
if
(!
device
.
supportsFlutterExit
)
{
await
device
.
stopApp
(
package
);
return
;
return
device
.
stopApp
(
package
);
}
await
refreshViews
();
if
(
views
==
null
||
views
.
isEmpty
)
{
return
;
return
device
.
stopApp
(
package
)
;
}
// If any of the flutter views are paused, we might not be able to
// cleanly exit since the service extension may not have been registered.
...
...
@@ -269,8 +270,7 @@ class FlutterDevice {
continue
;
}
if
(
isPauseEvent
(
isolate
.
pauseEvent
.
kind
))
{
await
device
.
stopApp
(
package
);
return
;
return
device
.
stopApp
(
package
);
}
}
for
(
final
FlutterView
view
in
views
)
{
...
...
@@ -288,11 +288,12 @@ class FlutterDevice {
stackTrace:
stackTrace
,
);
})
.
timeout
(
const
Duration
(
seconds:
2
)
,
onTimeout:
()
{
.
timeout
(
timeoutDelay
,
onTimeout:
()
{
// TODO(jonahwilliams): this only seems to fail on CI in the
// flutter_attach_android_test. This log should help verify this
// is where the tool is getting stuck.
globals
.
logger
.
printTrace
(
'error: vm service shutdown failed'
);
return
device
.
stopApp
(
package
);
});
}
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
0889e143
...
...
@@ -676,6 +676,7 @@ extension FlutterVmService on vm_service.VmService {
'ext.flutter.exit'
,
isolateId:
isolateId
,
).
catchError
((
dynamic
error
,
StackTrace
stackTrace
)
{
globals
.
logger
.
printTrace
(
'Failure in ext.flutter.exit:
$error
\n
$stackTrace
'
);
// Do nothing on sentinel or exception, the isolate already exited.
},
test:
(
dynamic
error
)
=>
error
is
vm_service
.
SentinelException
||
error
is
vm_service
.
RPCError
);
}
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
0889e143
...
...
@@ -815,6 +815,51 @@ void main() {
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
}));
test
(
'FlutterDevice will call stopApp if the exit request times out'
,
()
=>
testbed
.
run
(()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[
FakeVmServiceRequest
(
id:
'1'
,
method:
'_flutter.listViews'
,
args:
null
,
jsonResponse:
<
String
,
Object
>{
'views'
:
<
Object
>[
fakeFlutterView
.
toJson
(),
],
},
),
FakeVmServiceRequest
(
id:
'2'
,
method:
'getIsolate'
,
args:
<
String
,
Object
>{
'isolateId'
:
fakeUnpausedIsolate
.
id
,
},
jsonResponse:
fakeUnpausedIsolate
.
toJson
(),
),
FakeVmServiceRequest
(
id:
'3'
,
method:
'ext.flutter.exit'
,
args:
<
String
,
Object
>{
'isolateId'
:
fakeUnpausedIsolate
.
id
,
},
// Intentionally do not close isolate.
close:
false
,
)
]);
final
TestFlutterDevice
flutterDevice
=
TestFlutterDevice
(
mockDevice
,
<
FlutterView
>[
fakeFlutterView
],
);
flutterDevice
.
vmService
=
fakeVmServiceHost
.
vmService
;
when
(
mockDevice
.
supportsFlutterExit
).
thenReturn
(
true
);
await
flutterDevice
.
exitApps
(
timeoutDelay:
Duration
.
zero
,
);
verify
(
mockDevice
.
stopApp
(
any
)).
called
(
1
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
}));
test
(
'FlutterDevice will exit an un-paused isolate'
,
()
=>
testbed
.
run
(()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[
FakeVmServiceRequest
(
...
...
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