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
bcd28e7e
Unverified
Commit
bcd28e7e
authored
Jul 08, 2019
by
Jonah Williams
Committed by
GitHub
Jul 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't pause on tool tests (#35657)
parent
e1d43124
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
29 deletions
+4
-29
coverage_collector.dart
packages/flutter_tools/lib/src/test/coverage_collector.dart
+2
-24
tool_coverage.dart
packages/flutter_tools/tool/tool_coverage.dart
+2
-5
No files found.
packages/flutter_tools/lib/src/test/coverage_collector.dart
View file @
bcd28e7e
...
...
@@ -47,7 +47,7 @@ class CoverageCollector extends TestWatcher {
/// has been run to completion so that all coverage data has been recorded.
///
/// The returned [Future] completes when the coverage is collected.
Future
<
void
>
collectCoverageIsolate
(
Uri
observatoryUri
,
String
debugName
)
async
{
Future
<
void
>
collectCoverageIsolate
(
Uri
observatoryUri
)
async
{
assert
(
observatoryUri
!=
null
);
print
(
'collecting coverage data from
$observatoryUri
...'
);
final
Map
<
String
,
dynamic
>
data
=
await
collect
(
observatoryUri
,
(
String
libraryName
)
{
...
...
@@ -56,7 +56,7 @@ class CoverageCollector extends TestWatcher {
return
(
coverageDirectory
!=
null
)
||
(
flutterProject
==
null
)
||
libraryName
.
contains
(
flutterProject
.
manifest
.
appName
);
}
,
waitPaused:
true
,
debugName:
debugName
);
});
if
(
data
==
null
)
{
throw
Exception
(
'Failed to collect coverage.'
);
}
...
...
@@ -196,28 +196,6 @@ Future<Map<String, dynamic>> collect(Uri serviceUri, bool Function(String) libra
})
async
{
final
VMService
vmService
=
await
connector
(
serviceUri
);
await
vmService
.
getVM
();
if
(!
waitPaused
)
{
return
_getAllCoverage
(
vmService
,
libraryPredicate
);
}
final
Isolate
isolate
=
vmService
.
vm
.
isolates
.
firstWhere
((
Isolate
isolate
)
=>
isolate
.
name
==
debugName
);
const
int
kPollAttempts
=
20
;
int
i
=
0
;
while
(
i
<
kPollAttempts
)
{
await
isolate
.
load
();
if
(
isolate
.
pauseEvent
?.
kind
==
ServiceEvent
.
kPauseStart
)
{
break
;
}
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
50
));
i
+=
1
;
}
if
(
i
==
kPollAttempts
)
{
print
(
'Isolate
$debugName
was never paused, refusing to collect coverage'
);
return
const
<
String
,
dynamic
>{
'type'
:
'CodeCoverage'
,
'coverage'
:
<
Object
>[]
};
}
print
(
'isolate is paused, collecting coverage...'
);
return
_getAllCoverage
(
vmService
,
libraryPredicate
);
}
...
...
packages/flutter_tools/tool/tool_coverage.dart
View file @
bcd28e7e
...
...
@@ -77,10 +77,8 @@ class VMPlatform extends PlatformPlugin {
final
dynamic
channel
=
IsolateChannel
<
Object
>.
connectReceive
(
receivePort
)
.
transformStream
(
StreamTransformer
<
Object
,
Object
>.
fromHandlers
(
handleDone:
(
EventSink
<
Object
>
sink
)
async
{
try
{
// Pause the isolate so it is ready for coverage collection.
isolate
.
pause
();
// this will throw if collection fails.
await
coverageCollector
.
collectCoverageIsolate
(
info
.
serverUri
,
path
);
await
coverageCollector
.
collectCoverageIsolate
(
info
.
serverUri
);
}
finally
{
isolate
.
kill
(
priority:
Isolate
.
immediate
);
isolate
=
null
;
...
...
@@ -117,14 +115,13 @@ class VMPlatform extends PlatformPlugin {
return
await
Isolate
.
spawnUri
(
p
.
toUri
(
testPath
),
<
String
>[],
message
,
packageConfig:
p
.
toUri
(
'.packages'
),
checked:
true
,
debugName:
path
,
);
}
@override
Future
<
void
>
close
()
async
{
try
{
await
Future
.
wait
(
_pending
.
values
).
timeout
(
const
Duration
(
seconds:
10
));
await
Future
.
wait
(
_pending
.
values
).
timeout
(
const
Duration
(
minutes:
1
));
}
on
TimeoutException
{
// TODO(jonahwilliams): resolve whether there are any specific tests that
// get stuck or if it is a general infra issue with how we are collecting
...
...
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