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
6fd59890
Unverified
Commit
6fd59890
authored
Mar 23, 2023
by
Dan Field
Committed by
GitHub
Mar 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore spam from SurfaceSyncer (#123262)
Ignore spam from SurfaceSyncer
parent
ec7c4594
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+6
-1
adb_log_reader_test.dart
...tools/test/general.shard/android/adb_log_reader_test.dart
+37
-0
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
6fd59890
...
...
@@ -1096,6 +1096,11 @@ class AdbLogReader extends DeviceLogReader {
RegExp
(
r'^[F]\/[\S^:]+:\s+'
),
];
// E/SurfaceSyncer(22636): Failed to find sync for id=9
// Some versions of Android spew this out. It is inactionable to the end user
// and causes no problems for the application.
static
final
RegExp
_surfaceSyncerSpam
=
RegExp
(
r'^E/SurfaceSyncer\(\s*\d+\): Failed to find sync for id=\d+'
);
// 'F/libc(pid): Fatal signal 11'
static
final
RegExp
_fatalLog
=
RegExp
(
r'^F\/libc\s*\(\s*\d+\):\sFatal signal (\d+)'
);
...
...
@@ -1150,7 +1155,7 @@ class AdbLogReader extends DeviceLogReader {
}
}
}
else
if
(
appPid
!=
null
&&
int
.
parse
(
logMatch
.
group
(
1
)!)
==
appPid
)
{
acceptLine
=
true
;
acceptLine
=
!
_surfaceSyncerSpam
.
hasMatch
(
line
)
;
if
(
_fatalLog
.
hasMatch
(
line
))
{
// Hit fatal signal, app is now crashing
...
...
packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart
View file @
6fd59890
...
...
@@ -19,6 +19,43 @@ const String kLastLogcatTimestamp = '11-27 15:39:04.506';
const
String
kDummyLine
=
'Contents are not important
\n
'
;
void
main
(
)
{
testWithoutContext
(
'AdbLogReader ignores spam from SurfaceSyncer'
,
()
async
{
const
int
appPid
=
1
;
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
const
<
String
>[
'adb'
,
'-s'
,
'1234'
,
'shell'
,
'-x'
,
'logcat'
,
'-v'
,
'time'
,
],
completer:
Completer
<
void
>.
sync
(),
stdout:
'
$kDummyLine
'
'05-11 12:54:46.665 W/flutter(
$appPid
): Hello there!
\n
'
'05-11 12:54:46.665 E/SurfaceSyncer(
$appPid
): Failed to find sync for id=9
\n
'
'05-11 12:54:46.665 E/SurfaceSyncer(
$appPid
): Failed to find sync for id=10
\n
'
),
]);
final
AdbLogReader
logReader
=
await
AdbLogReader
.
createLogReader
(
createFakeDevice
(
null
),
processManager
,
)..
appPid
=
appPid
;
final
Completer
<
void
>
onDone
=
Completer
<
void
>.
sync
();
final
List
<
String
>
emittedLines
=
<
String
>[];
logReader
.
logLines
.
listen
((
String
line
)
{
emittedLines
.
add
(
line
);
},
onDone:
onDone
.
complete
);
await
null
;
logReader
.
dispose
();
await
onDone
.
future
;
expect
(
emittedLines
,
const
<
String
>[
'W/flutter(
$appPid
): Hello there!'
]);
});
testWithoutContext
(
'AdbLogReader calls adb logcat with expected flags apiVersion 21'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
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