Audit devicelab log streaming for nullability (#84820)
This commit is contained in:
@@ -615,10 +615,11 @@ class AndroidDevice extends Device {
|
||||
|
||||
@override
|
||||
Future<void> stopLoggingToSink() async {
|
||||
assert(_loggingProcess != null);
|
||||
_abortedLogging = true;
|
||||
_loggingProcess.kill();
|
||||
await _loggingProcess.exitCode;
|
||||
if (_loggingProcess != null) {
|
||||
_abortedLogging = true;
|
||||
_loggingProcess.kill();
|
||||
await _loggingProcess.exitCode;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -877,10 +878,11 @@ class IosDevice extends Device {
|
||||
|
||||
@override
|
||||
Future<void> stopLoggingToSink() async {
|
||||
assert(_loggingProcess != null);
|
||||
_abortedLogging = true;
|
||||
_loggingProcess.kill();
|
||||
await _loggingProcess.exitCode;
|
||||
if (_loggingProcess != null) {
|
||||
_abortedLogging = true;
|
||||
_loggingProcess.kill();
|
||||
await _loggingProcess.exitCode;
|
||||
}
|
||||
}
|
||||
|
||||
// The methods below are stubs for now. They will need to be expanded.
|
||||
|
||||
@@ -161,9 +161,8 @@ class _TaskRunner {
|
||||
result = await futureResult;
|
||||
} finally {
|
||||
if (device != null && device.canStreamLogs) {
|
||||
assert(sink != null);
|
||||
await device.stopLoggingToSink();
|
||||
await sink.close();
|
||||
await sink?.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import 'package:path/path.dart' as path;
|
||||
import 'package:process/process.dart';
|
||||
import 'package:stack_trace/stack_trace.dart';
|
||||
|
||||
import 'host_agent.dart';
|
||||
import 'task_result.dart';
|
||||
|
||||
/// Virtual current working directory, which affect functions, such as [exec].
|
||||
@@ -453,6 +454,11 @@ List<String> flutterCommandArgs(String command, List<String> options) {
|
||||
'--device-timeout',
|
||||
'5',
|
||||
],
|
||||
|
||||
if (command == 'drive' && hostAgent.dumpDirectory != null) ...<String>[
|
||||
'--screenshot',
|
||||
hostAgent.dumpDirectory.path,
|
||||
],
|
||||
if (localEngine != null) ...<String>['--local-engine', localEngine],
|
||||
if (localEngineSrcPath != null) ...<String>['--local-engine-src-path', localEngineSrcPath],
|
||||
...options,
|
||||
|
||||
@@ -10,7 +10,6 @@ import 'dart:math' as math;
|
||||
|
||||
import '../framework/devices.dart';
|
||||
import '../framework/framework.dart';
|
||||
import '../framework/host_agent.dart';
|
||||
import '../framework/task_result.dart';
|
||||
import '../framework/utils.dart';
|
||||
|
||||
@@ -104,8 +103,6 @@ class GalleryTransitionTest {
|
||||
'test_driver/$testDriver.dart',
|
||||
'-d',
|
||||
deviceId,
|
||||
'--screenshot',
|
||||
hostAgent.dumpDirectory.path,
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
import '../framework/devices.dart';
|
||||
import '../framework/framework.dart';
|
||||
import '../framework/host_agent.dart';
|
||||
import '../framework/task_result.dart';
|
||||
import '../framework/utils.dart';
|
||||
|
||||
@@ -161,8 +160,6 @@ class DriverTest {
|
||||
testTarget,
|
||||
'-d',
|
||||
deviceId,
|
||||
'--screenshot',
|
||||
hostAgent.dumpDirectory.path,
|
||||
...extraOptions,
|
||||
];
|
||||
await flutter('drive', options: options, environment: Map<String, String>.from(environment));
|
||||
|
||||
@@ -314,8 +314,6 @@ TaskFunction createStackSizeTest() {
|
||||
'--driver', testDriver,
|
||||
'-d',
|
||||
deviceId,
|
||||
'--screenshot',
|
||||
hostAgent.dumpDirectory.path,
|
||||
]);
|
||||
final Map<String, dynamic> data = json.decode(
|
||||
file('${_testOutputDirectory(testDirectory)}/stack_size.json').readAsStringSync(),
|
||||
@@ -411,8 +409,6 @@ TaskFunction createsScrollSmoothnessPerfTest() {
|
||||
'-t', testTarget,
|
||||
'-d',
|
||||
deviceId,
|
||||
'--screenshot',
|
||||
hostAgent.dumpDirectory.path,
|
||||
]);
|
||||
final Map<String, dynamic> data = json.decode(
|
||||
file('${_testOutputDirectory(testDirectory)}/scroll_smoothness_test.json').readAsStringSync(),
|
||||
@@ -464,8 +460,6 @@ TaskFunction createFramePolicyIntegrationTest() {
|
||||
'-t', testTarget,
|
||||
'-d',
|
||||
deviceId,
|
||||
'--screenshot',
|
||||
hostAgent.dumpDirectory.path,
|
||||
]);
|
||||
final Map<String, dynamic> data = json.decode(
|
||||
file('${_testOutputDirectory(testDirectory)}/frame_policy_event_delay.json').readAsStringSync(),
|
||||
@@ -585,16 +579,20 @@ class StartupTest {
|
||||
results.add(data);
|
||||
} else {
|
||||
currentFailures += 1;
|
||||
await flutter(
|
||||
'screenshot',
|
||||
options: <String>[
|
||||
'-d',
|
||||
device.deviceId,
|
||||
'--out',
|
||||
hostAgent.dumpDirectory.childFile('screenshot_startup_failure_$currentFailures.png').path,
|
||||
],
|
||||
canFail: true,
|
||||
);
|
||||
if (hostAgent.dumpDirectory != null) {
|
||||
await flutter(
|
||||
'screenshot',
|
||||
options: <String>[
|
||||
'-d',
|
||||
device.deviceId,
|
||||
'--out',
|
||||
hostAgent.dumpDirectory
|
||||
.childFile('screenshot_startup_failure_$currentFailures.png')
|
||||
.path,
|
||||
],
|
||||
canFail: true,
|
||||
);
|
||||
}
|
||||
i -= 1;
|
||||
if (currentFailures == maxFailures) {
|
||||
return TaskResult.failure('Application failed to start $maxFailures times');
|
||||
@@ -830,8 +828,6 @@ class PerfTest {
|
||||
...<String>['--dart-define', dartDefine],
|
||||
'-d',
|
||||
deviceId,
|
||||
'--screenshot',
|
||||
hostAgent.dumpDirectory.path,
|
||||
]);
|
||||
final Map<String, dynamic> data = json.decode(
|
||||
file('${_testOutputDirectory(testDirectory)}/$resultFilename.json').readAsStringSync(),
|
||||
@@ -1461,8 +1457,6 @@ class DevToolsMemoryTest {
|
||||
'drive',
|
||||
options: <String>[
|
||||
'-d', _device.deviceId,
|
||||
'--screenshot',
|
||||
hostAgent.dumpDirectory.path,
|
||||
'--profile',
|
||||
'--profile-memory', _kJsonFileName,
|
||||
'--no-publish-port',
|
||||
|
||||
Reference in New Issue
Block a user