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
001323a2
Unverified
Commit
001323a2
authored
Apr 30, 2021
by
Jonah Williams
Committed by
GitHub
Apr 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] remove timeout from iOS device startup (#81229)
parent
ace61f01
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
7 deletions
+48
-7
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+7
-7
ios_device_start_prebuilt_test.dart
...est/general.shard/ios/ios_device_start_prebuilt_test.dart
+41
-0
No files found.
packages/flutter_tools/lib/src/ios/devices.dart
View file @
001323a2
...
...
@@ -312,6 +312,7 @@ class IOSDevice extends Device {
bool
prebuiltApplication
=
false
,
bool
ipv6
=
false
,
String
userIdentifier
,
@visibleForTesting
Duration
discoveryTimeout
,
})
async
{
String
packageId
;
...
...
@@ -426,13 +427,12 @@ class IOSDevice extends Device {
return
LaunchResult
.
succeeded
();
}
_logger
.
printTrace
(
'Application launched on the device. Waiting for observatory port.'
);
Uri
localUri
;
try
{
localUri
=
await
observatoryDiscovery
.
uri
.
timeout
(
const
Duration
(
seconds:
30
));
}
on
TimeoutException
{
await
observatoryDiscovery
.
cancel
();
}
_logger
.
printTrace
(
'Application launched on the device. Waiting for observatory url.'
);
final
Timer
timer
=
Timer
(
discoveryTimeout
??
const
Duration
(
seconds:
30
),
()
{
_logger
.
printError
(
'iOS Observatory not discovered after 30 seconds. This is taking much longer than expected...'
);
});
final
Uri
localUri
=
await
observatoryDiscovery
.
uri
;
timer
.
cancel
();
if
(
localUri
==
null
)
{
iosDeployDebugger
?.
detach
();
return
LaunchResult
.
failed
();
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart
View file @
001323a2
...
...
@@ -178,6 +178,47 @@ void main() {
expect
(
await
device
.
stopApp
(
iosApp
),
false
);
});
testWithoutContext
(
'IOSDevice.startApp prints warning message if discovery takes longer than configured timeout'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
kAttachDebuggerCommand
,
]);
final
IOSDevice
device
=
setUpIOSDevice
(
processManager:
processManager
,
fileSystem:
fileSystem
,
logger:
logger
,
);
final
IOSApp
iosApp
=
PrebuiltIOSApp
(
projectBundleId:
'app'
,
bundleName:
'Runner'
,
bundleDir:
fileSystem
.
currentDirectory
,
);
final
FakeDeviceLogReader
deviceLogReader
=
FakeDeviceLogReader
();
device
.
portForwarder
=
const
NoOpDevicePortForwarder
();
device
.
setLogReader
(
iosApp
,
deviceLogReader
);
// Start writing messages to the log reader.
Timer
.
run
(()
async
{
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
1
));
deviceLogReader
.
addLine
(
'Foo'
);
deviceLogReader
.
addLine
(
'Observatory listening on http://127.0.0.1:456'
);
});
final
LaunchResult
launchResult
=
await
device
.
startApp
(
iosApp
,
prebuiltApplication:
true
,
debuggingOptions:
DebuggingOptions
.
enabled
(
BuildInfo
.
debug
),
platformArgs:
<
String
,
dynamic
>{},
discoveryTimeout:
Duration
.
zero
,
);
expect
(
launchResult
.
started
,
true
);
expect
(
launchResult
.
hasObservatory
,
true
);
expect
(
await
device
.
stopApp
(
iosApp
),
false
);
expect
(
logger
.
errorText
,
contains
(
'iOS Observatory not discovered after 30 seconds. This is taking much longer than expected...'
));
});
testWithoutContext
(
'IOSDevice.startApp succeeds in release mode'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
...
...
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