Unverified Commit 36c5e321 authored by xster's avatar xster Committed by GitHub

Print 50000$ monopoly money (#27531)

parent 9abe4c6d
...@@ -294,7 +294,7 @@ class AndroidLicenseValidator extends DoctorValidator { ...@@ -294,7 +294,7 @@ class AndroidLicenseValidator extends DoctorValidator {
// The real stdin will never finish streaming. Pipe until the child process // The real stdin will never finish streaming. Pipe until the child process
// finishes. // finishes.
process.stdin.addStream(stdin); // ignore: unawaited_futures unawaited(process.stdin.addStream(stdin));
// Wait for stdout and stderr to be fully processed, because process.exitCode // Wait for stdout and stderr to be fully processed, because process.exitCode
// may complete first. // may complete first.
await waitGroup<void>(<Future<void>>[ await waitGroup<void>(<Future<void>>[
......
...@@ -39,3 +39,14 @@ class ToolExit implements Exception { ...@@ -39,3 +39,14 @@ class ToolExit implements Exception {
@override @override
String toString() => 'Exception: $message'; String toString() => 'Exception: $message';
} }
/// Indicates to the linter that the given future is intentionally not `await`-ed.
///
/// Has the same functionality as `unawaited` from `package:pedantic`.
///
/// In an async context, it is normally expected than all Futures are awaited,
/// and that is the basis of the lint unawaited_futures which is turned on for
/// the flutter_tools package. However, there are times where one or more
/// futures are intentionally not awaited. This function may be used to ignore a
/// particular future. It silences the unawaited_futures lint.
void unawaited(Future<void> future) { }
...@@ -6,6 +6,7 @@ import 'dart:async'; ...@@ -6,6 +6,7 @@ import 'dart:async';
import '../convert.dart'; import '../convert.dart';
import '../globals.dart'; import '../globals.dart';
import 'common.dart';
import 'file_system.dart'; import 'file_system.dart';
import 'io.dart'; import 'io.dart';
import 'process_manager.dart'; import 'process_manager.dart';
...@@ -193,7 +194,7 @@ Future<int> runInteractively(List<String> command, { ...@@ -193,7 +194,7 @@ Future<int> runInteractively(List<String> command, {
); );
// The real stdin will never finish streaming. Pipe until the child process // The real stdin will never finish streaming. Pipe until the child process
// finishes. // finishes.
process.stdin.addStream(stdin); // ignore: unawaited_futures unawaited(process.stdin.addStream(stdin));
// Wait for stdout and stderr to be fully processed, because process.exitCode // Wait for stdout and stderr to be fully processed, because process.exitCode
// may complete first. // may complete first.
await Future.wait<dynamic>(<Future<dynamic>>[ await Future.wait<dynamic>(<Future<dynamic>>[
......
...@@ -93,11 +93,11 @@ class AnalyzeOnce extends AnalyzeBase { ...@@ -93,11 +93,11 @@ class AnalyzeOnce extends AnalyzeBase {
await server.start(); await server.start();
// Completing the future in the callback can't fail. // Completing the future in the callback can't fail.
server.onExit.then<void>((int exitCode) { // ignore: unawaited_futures unawaited(server.onExit.then<void>((int exitCode) {
if (!analysisCompleter.isCompleted) { if (!analysisCompleter.isCompleted) {
analysisCompleter.completeError('analysis server exited: $exitCode'); analysisCompleter.completeError('analysis server exited: $exitCode');
} }
}); }));
Cache.releaseLockEarly(); Cache.releaseLockEarly();
......
...@@ -421,23 +421,24 @@ class AppDomain extends Domain { ...@@ -421,23 +421,24 @@ class AppDomain extends Domain {
connectionInfoCompleter = Completer<DebugConnectionInfo>(); connectionInfoCompleter = Completer<DebugConnectionInfo>();
// We don't want to wait for this future to complete and callbacks won't fail. // We don't want to wait for this future to complete and callbacks won't fail.
// As it just writes to stdout. // As it just writes to stdout.
connectionInfoCompleter.future.then<void>((DebugConnectionInfo info) { // ignore: unawaited_futures unawaited(connectionInfoCompleter.future.then<void>(
final Map<String, dynamic> params = <String, dynamic>{ (DebugConnectionInfo info) {
'port': info.httpUri.port, final Map<String, dynamic> params = <String, dynamic>{
'wsUri': info.wsUri.toString(), 'port': info.httpUri.port,
}; 'wsUri': info.wsUri.toString(),
if (info.baseUri != null) };
params['baseUri'] = info.baseUri; if (info.baseUri != null)
_sendAppEvent(app, 'debugPort', params); params['baseUri'] = info.baseUri;
}); _sendAppEvent(app, 'debugPort', params);
},
));
} }
final Completer<void> appStartedCompleter = Completer<void>(); final Completer<void> appStartedCompleter = Completer<void>();
// We don't want to wait for this future to complete, and callbacks won't fail, // We don't want to wait for this future to complete, and callbacks won't fail,
// as it just writes to stdout. // as it just writes to stdout.
appStartedCompleter.future // ignore: unawaited_futures unawaited(appStartedCompleter.future.then<void>((void value) {
.then<void>((void value) { _sendAppEvent(app, 'started');
_sendAppEvent(app, 'started'); }));
});
await app._runInZone<void>(this, () async { await app._runInZone<void>(this, () async {
try { try {
......
...@@ -398,9 +398,9 @@ class RunCommand extends RunCommandBase { ...@@ -398,9 +398,9 @@ class RunCommand extends RunCommandBase {
// Do not add more operations to the future. // Do not add more operations to the future.
final Completer<void> appStartedTimeRecorder = Completer<void>.sync(); final Completer<void> appStartedTimeRecorder = Completer<void>.sync();
// This callback can't throw. // This callback can't throw.
appStartedTimeRecorder.future.then<void>( // ignore: unawaited_futures unawaited(appStartedTimeRecorder.future.then<void>(
(_) { appStartedTime = systemClock.now(); } (_) { appStartedTime = systemClock.now(); }
); ));
final int result = await runner.run( final int result = await runner.run(
appStartedCompleter: appStartedTimeRecorder, appStartedCompleter: appStartedTimeRecorder,
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:math' as math; import 'dart:math' as math;
import '../base/common.dart';
import '../base/file_system.dart' hide IOSink; import '../base/file_system.dart' hide IOSink;
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/io.dart'; import '../base/io.dart';
...@@ -42,7 +43,7 @@ class AnalysisServer { ...@@ -42,7 +43,7 @@ class AnalysisServer {
printTrace('dart ${command.skip(1).join(' ')}'); printTrace('dart ${command.skip(1).join(' ')}');
_process = await processManager.start(command); _process = await processManager.start(command);
// This callback hookup can't throw. // This callback hookup can't throw.
_process.exitCode.whenComplete(() => _process = null); // ignore: unawaited_futures unawaited(_process.exitCode.whenComplete(() => _process = null));
final Stream<String> errorStream = final Stream<String> errorStream =
_process.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter()); _process.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter());
......
...@@ -7,6 +7,7 @@ import 'package:json_rpc_2/json_rpc_2.dart' as rpc; ...@@ -7,6 +7,7 @@ import 'package:json_rpc_2/json_rpc_2.dart' as rpc;
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'asset.dart'; import 'asset.dart';
import 'base/common.dart';
import 'base/context.dart'; import 'base/context.dart';
import 'base/file_system.dart'; import 'base/file_system.dart';
import 'base/io.dart'; import 'base/io.dart';
...@@ -336,7 +337,7 @@ class _DevFSHttpWriter { ...@@ -336,7 +337,7 @@ class _DevFSHttpWriter {
if (retry < kMaxRetries) { if (retry < kMaxRetries) {
printTrace('Retrying writing "$deviceUri" to DevFS due to error: $e'); printTrace('Retrying writing "$deviceUri" to DevFS due to error: $e');
// Synchronization is handled by the _completer below. // Synchronization is handled by the _completer below.
_scheduleWrite(deviceUri, content, retry + 1); // ignore: unawaited_futures unawaited(_scheduleWrite(deviceUri, content, retry + 1));
return; return;
} else { } else {
printError('Error writing "$deviceUri" to DevFS: $e'); printError('Error writing "$deviceUri" to DevFS: $e');
......
...@@ -403,11 +403,11 @@ class _FuchsiaPortForwarder extends DevicePortForwarder { ...@@ -403,11 +403,11 @@ class _FuchsiaPortForwarder extends DevicePortForwarder {
'-L', '$hostPort:$_ipv4Loopback:$devicePort', device.id, 'true' '-L', '$hostPort:$_ipv4Loopback:$devicePort', device.id, 'true'
]; ];
final Process process = await processManager.start(command); final Process process = await processManager.start(command);
process.exitCode.then((int exitCode) { // ignore: unawaited_futures unawaited(process.exitCode.then((int exitCode) {
if (exitCode != 0) { if (exitCode != 0) {
throwToolExit('Failed to forward port:$devicePort'); throwToolExit('Failed to forward port:$devicePort');
} }
}); }));
_processes[hostPort] = process; _processes[hostPort] = process;
_forwardedPorts.add(ForwardedPort(hostPort, devicePort)); _forwardedPorts.add(ForwardedPort(hostPort, devicePort));
return hostPort; return hostPort;
......
...@@ -158,7 +158,7 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({ ...@@ -158,7 +158,7 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
final String opensslOutput = await utf8.decodeStream(opensslProcess.stdout); final String opensslOutput = await utf8.decodeStream(opensslProcess.stdout);
// Fire and forget discard of the stderr stream so we don't hold onto resources. // Fire and forget discard of the stderr stream so we don't hold onto resources.
// Don't care about the result. // Don't care about the result.
opensslProcess.stderr.drain<String>(); // ignore: unawaited_futures unawaited(opensslProcess.stderr.drain<String>());
if (await opensslProcess.exitCode != 0) if (await opensslProcess.exitCode != 0)
return null; return null;
......
...@@ -480,7 +480,7 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -480,7 +480,7 @@ Future<XcodeBuildResult> buildXcodeProject({
} }
// Trigger the start of the pipe -> stdout loop. Ignore exceptions. // Trigger the start of the pipe -> stdout loop. Ignore exceptions.
listenToScriptOutputLine(); // ignore: unawaited_futures unawaited(listenToScriptOutputLine());
buildCommands.add('SCRIPT_OUTPUT_STREAM_FILE=${scriptOutputPipeFile.absolute.path}'); buildCommands.add('SCRIPT_OUTPUT_STREAM_FILE=${scriptOutputPipeFile.absolute.path}');
} }
......
...@@ -538,10 +538,10 @@ class _IOSSimulatorLogReader extends DeviceLogReader { ...@@ -538,10 +538,10 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
// We don't want to wait for the process or its callback. Best effort // We don't want to wait for the process or its callback. Best effort
// cleanup in the callback. // cleanup in the callback.
_deviceProcess.exitCode.whenComplete(() { // ignore: unawaited_futures unawaited(_deviceProcess.exitCode.whenComplete(() {
if (_linesController.hasListener) if (_linesController.hasListener)
_linesController.close(); _linesController.close();
}); }));
} }
// Match the log prefix (in order to shorten it): // Match the log prefix (in order to shorten it):
......
...@@ -9,6 +9,7 @@ import 'package:meta/meta.dart'; ...@@ -9,6 +9,7 @@ import 'package:meta/meta.dart';
import 'application_package.dart'; import 'application_package.dart';
import 'artifacts.dart'; import 'artifacts.dart';
import 'asset.dart'; import 'asset.dart';
import 'base/common.dart';
import 'base/file_system.dart'; import 'base/file_system.dart';
import 'base/io.dart'; import 'base/io.dart';
import 'base/logger.dart'; import 'base/logger.dart';
...@@ -739,10 +740,10 @@ abstract class ResidentRunner { ...@@ -739,10 +740,10 @@ abstract class ResidentRunner {
// This hooks up callbacks for when the connection stops in the future. // This hooks up callbacks for when the connection stops in the future.
// We don't want to wait for them. We don't handle errors in those callbacks' // We don't want to wait for them. We don't handle errors in those callbacks'
// futures either because they just print to logger and is not critical. // futures either because they just print to logger and is not critical.
service.done.then<void>( // ignore: unawaited_futures unawaited(service.done.then<void>(
_serviceProtocolDone, _serviceProtocolDone,
onError: _serviceProtocolError onError: _serviceProtocolError
).whenComplete(_serviceDisconnected); ).whenComplete(_serviceDisconnected));
} }
} }
} }
......
...@@ -502,13 +502,17 @@ class HotRunner extends ResidentRunner { ...@@ -502,13 +502,17 @@ class HotRunner extends ResidentRunner {
// Reload the isolate. // Reload the isolate.
final Completer<void> completer = Completer<void>(); final Completer<void> completer = Completer<void>();
futures.add(completer.future); futures.add(completer.future);
view.uiIsolate.reload().then((ServiceObject _) { // ignore: unawaited_futures unawaited(view.uiIsolate.reload().then(
final ServiceEvent pauseEvent = view.uiIsolate.pauseEvent; (ServiceObject _) {
if ((pauseEvent != null) && pauseEvent.isPauseEvent) { final ServiceEvent pauseEvent = view.uiIsolate.pauseEvent;
// Resume the isolate so that it can be killed by the embedder. if ((pauseEvent != null) && pauseEvent.isPauseEvent) {
return view.uiIsolate.resume(); // Resume the isolate so that it can be killed by the embedder.
} return view.uiIsolate.resume();
}).whenComplete(() { completer.complete(null); }); }
},
).whenComplete(
() { completer.complete(null); },
));
} }
} }
} }
...@@ -681,15 +685,19 @@ class HotRunner extends ResidentRunner { ...@@ -681,15 +685,19 @@ class HotRunner extends ResidentRunner {
final List<Future<Map<String, dynamic>>> reportFutures = device.reloadSources( final List<Future<Map<String, dynamic>>> reportFutures = device.reloadSources(
entryPath, pause: pause entryPath, pause: pause
); );
Future.wait(reportFutures).then((List<Map<String, dynamic>> reports) async { // ignore: unawaited_futures unawaited(Future.wait(reportFutures).then(
// TODO(aam): Investigate why we are validating only first reload report, (List<Map<String, dynamic>> reports) async {
// which seems to be current behavior // TODO(aam): Investigate why we are validating only first reload report,
final Map<String, dynamic> firstReport = reports.first; // which seems to be current behavior
// Don't print errors because they will be printed further down when final Map<String, dynamic> firstReport = reports.first;
// `validateReloadReport` is called again. // Don't print errors because they will be printed further down when
await device.updateReloadStatus(validateReloadReport(firstReport, printErrors: false)); // `validateReloadReport` is called again.
completer.complete(DeviceReloadReport(device, reports)); await device.updateReloadStatus(
}); validateReloadReport(firstReport, printErrors: false),
);
completer.complete(DeviceReloadReport(device, reports));
},
));
} }
final List<DeviceReloadReport> reports = await Future.wait(allReportsFutures); final List<DeviceReloadReport> reports = await Future.wait(allReportsFutures);
for (DeviceReloadReport report in reports) { for (DeviceReloadReport report in reports) {
...@@ -749,9 +757,9 @@ class HotRunner extends ResidentRunner { ...@@ -749,9 +757,9 @@ class HotRunner extends ResidentRunner {
futuresViews.add(view.uiIsolate.reload()); futuresViews.add(view.uiIsolate.reload());
} }
final Completer<void> deviceCompleter = Completer<void>(); final Completer<void> deviceCompleter = Completer<void>();
Future.wait(futuresViews).whenComplete(() { // ignore: unawaited_futures unawaited(Future.wait(futuresViews).whenComplete(() {
deviceCompleter.complete(device.refreshViews()); deviceCompleter.complete(device.refreshViews());
}); }));
allDevices.add(deviceCompleter.future); allDevices.add(deviceCompleter.future);
} }
await Future.wait(allDevices); await Future.wait(allDevices);
......
...@@ -495,9 +495,9 @@ class _FlutterPlatform extends PlatformPlugin { ...@@ -495,9 +495,9 @@ class _FlutterPlatform extends PlatformPlugin {
bool controllerSinkClosed = false; bool controllerSinkClosed = false;
try { try {
// Callback can't throw since it's just setting a variable. // Callback can't throw since it's just setting a variable.
controller.sink.done.whenComplete(() { // ignore: unawaited_futures unawaited(controller.sink.done.whenComplete(() {
controllerSinkClosed = true; controllerSinkClosed = true;
}); }));
// Prepare our WebSocket server to talk to the engine subproces. // Prepare our WebSocket server to talk to the engine subproces.
final HttpServer server = await HttpServer.bind(host, port); final HttpServer server = await HttpServer.bind(host, port);
...@@ -653,7 +653,7 @@ class _FlutterPlatform extends PlatformPlugin { ...@@ -653,7 +653,7 @@ class _FlutterPlatform extends PlatformPlugin {
shellPath); shellPath);
controller.sink.addError(message); controller.sink.addError(message);
// Awaited for with 'sink.done' below. // Awaited for with 'sink.done' below.
controller.sink.close(); // ignore: unawaited_futures unawaited(controller.sink.close());
printTrace('test $ourTestCount: waiting for controller sink to close'); printTrace('test $ourTestCount: waiting for controller sink to close');
await controller.sink.done; await controller.sink.done;
await watcher?.handleTestCrashed(ProcessEvent(ourTestCount, process)); await watcher?.handleTestCrashed(ProcessEvent(ourTestCount, process));
...@@ -666,7 +666,7 @@ class _FlutterPlatform extends PlatformPlugin { ...@@ -666,7 +666,7 @@ class _FlutterPlatform extends PlatformPlugin {
final String message = _getErrorMessage('Test never connected to test harness.', testPath, shellPath); final String message = _getErrorMessage('Test never connected to test harness.', testPath, shellPath);
controller.sink.addError(message); controller.sink.addError(message);
// Awaited for with 'sink.done' below. // Awaited for with 'sink.done' below.
controller.sink.close(); // ignore: unawaited_futures unawaited(controller.sink.close());
printTrace('test $ourTestCount: waiting for controller sink to close'); printTrace('test $ourTestCount: waiting for controller sink to close');
await controller.sink.done; await controller.sink.done;
await watcher await watcher
...@@ -748,7 +748,7 @@ class _FlutterPlatform extends PlatformPlugin { ...@@ -748,7 +748,7 @@ class _FlutterPlatform extends PlatformPlugin {
shellPath); shellPath);
controller.sink.addError(message); controller.sink.addError(message);
// Awaited for with 'sink.done' below. // Awaited for with 'sink.done' below.
controller.sink.close(); // ignore: unawaited_futures unawaited(controller.sink.close());
printTrace('test $ourTestCount: waiting for controller sink to close'); printTrace('test $ourTestCount: waiting for controller sink to close');
await controller.sink.done; await controller.sink.done;
break; break;
...@@ -792,7 +792,7 @@ class _FlutterPlatform extends PlatformPlugin { ...@@ -792,7 +792,7 @@ class _FlutterPlatform extends PlatformPlugin {
} }
if (!controllerSinkClosed) { if (!controllerSinkClosed) {
// Waiting below with await. // Waiting below with await.
controller.sink.close(); // ignore: unawaited_futures unawaited(controller.sink.close());
printTrace('test $ourTestCount: waiting for controller sink to close'); printTrace('test $ourTestCount: waiting for controller sink to close');
await controller.sink.done; await controller.sink.done;
} }
......
...@@ -152,7 +152,7 @@ class FlutterTesterDevice extends Device { ...@@ -152,7 +152,7 @@ class FlutterTesterDevice extends Device {
}, },
); );
// Setting a bool can't fail in the callback. // Setting a bool can't fail in the callback.
_process.exitCode.then<void>((_) => _isRunning = false); // ignore: unawaited_futures unawaited(_process.exitCode.then<void>((_) => _isRunning = false));
_process.stdout _process.stdout
.transform<String>(utf8.decoder) .transform<String>(utf8.decoder)
.transform<String>(const LineSplitter()) .transform<String>(const LineSplitter())
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/context.dart'; import 'package:flutter_tools/src/base/context.dart';
...@@ -445,23 +446,26 @@ example:org-dartlang-app:///lib/ ...@@ -445,23 +446,26 @@ example:org-dartlang-app:///lib/
])); ]));
// The test manages timing via completers. // The test manages timing via completers.
generator.recompile( // ignore: unawaited_futures unawaited(
'/path/to/main.dart', generator.recompile(
null, /* invalidatedFiles */ '/path/to/main.dart',
outputPath: '/build/', null, /* invalidatedFiles */
).then((CompilerOutput outputCompile) { outputPath: '/build/',
expect(logger.errorText, ).then((CompilerOutput outputCompile) {
equals('\nCompiler message:\nline1\nline2\n')); expect(logger.errorText,
expect(outputCompile.outputFilename, equals('/path/to/main.dart.dill')); equals('\nCompiler message:\nline1\nline2\n'));
expect(outputCompile.outputFilename, equals('/path/to/main.dart.dill'));
compileExpressionResponseCompleter1.complete(Future<List<int>>.value(utf8.encode(
'result def\nline1\nline2\ndef /path/to/main.dart.dill.incremental 0\n' compileExpressionResponseCompleter1.complete(Future<List<int>>.value(utf8.encode(
))); 'result def\nline1\nline2\ndef /path/to/main.dart.dill.incremental 0\n'
}); )));
}),
);
// The test manages timing via completers. // The test manages timing via completers.
final Completer<bool> lastExpressionCompleted = Completer<bool>(); final Completer<bool> lastExpressionCompleted = Completer<bool>();
generator.compileExpression('0+1', null, null, null, null, false).then( // ignore: unawaited_futures unawaited(
generator.compileExpression('0+1', null, null, null, null, false).then(
(CompilerOutput outputExpression) { (CompilerOutput outputExpression) {
expect(outputExpression, isNotNull); expect(outputExpression, isNotNull);
expect(outputExpression.outputFilename, expect(outputExpression.outputFilename,
...@@ -470,17 +474,22 @@ example:org-dartlang-app:///lib/ ...@@ -470,17 +474,22 @@ example:org-dartlang-app:///lib/
compileExpressionResponseCompleter2.complete(Future<List<int>>.value(utf8.encode( compileExpressionResponseCompleter2.complete(Future<List<int>>.value(utf8.encode(
'result def\nline1\nline2\ndef /path/to/main.dart.dill.incremental 0\n' 'result def\nline1\nline2\ndef /path/to/main.dart.dill.incremental 0\n'
))); )));
}); },
),
);
// The test manages timing via completers. // The test manages timing via completers.
generator.compileExpression('1+1', null, null, null, null, false).then( // ignore: unawaited_futures unawaited(
generator.compileExpression('1+1', null, null, null, null, false).then(
(CompilerOutput outputExpression) { (CompilerOutput outputExpression) {
expect(outputExpression, isNotNull); expect(outputExpression, isNotNull);
expect(outputExpression.outputFilename, expect(outputExpression.outputFilename,
equals('/path/to/main.dart.dill.incremental')); equals('/path/to/main.dart.dill.incremental'));
expect(outputExpression.errorCount, 0); expect(outputExpression.errorCount, 0);
lastExpressionCompleted.complete(true); lastExpressionCompleted.complete(true);
}); },
)
);
compileResponseCompleter.complete(Future<List<int>>.value(utf8.encode( compileResponseCompleter.complete(Future<List<int>>.value(utf8.encode(
'result abc\nline1\nline2\nabc /path/to/main.dart.dill 0\n' 'result abc\nline1\nline2\nabc /path/to/main.dart.dill 0\n'
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'dart:async'; import 'dart:async';
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/file_system.dart';
import 'package:vm_service_lib/vm_service_lib.dart'; import 'package:vm_service_lib/vm_service_lib.dart';
...@@ -76,10 +77,10 @@ void main() { ...@@ -76,10 +77,10 @@ void main() {
}, },
); );
await _flutter.resume(); // we start paused so we can set up our TICK 1 listener before the app starts await _flutter.resume(); // we start paused so we can set up our TICK 1 listener before the app starts
sawTick1.future.timeout( // ignore: unawaited_futures unawaited(sawTick1.future.timeout(
const Duration(seconds: 5), const Duration(seconds: 5),
onTimeout: () { print('The test app is taking longer than expected to print its synchronization line...'); }, onTimeout: () { print('The test app is taking longer than expected to print its synchronization line...'); },
); ));
await sawTick1.future; // after this, app is in steady state await sawTick1.future; // after this, app is in steady state
await _flutter.addBreakpoint( await _flutter.addBreakpoint(
_project.scheduledBreakpointUri, _project.scheduledBreakpointUri,
......
...@@ -6,6 +6,7 @@ import 'dart:async'; ...@@ -6,6 +6,7 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/io.dart';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
...@@ -104,10 +105,10 @@ abstract class FlutterTestDriver { ...@@ -104,10 +105,10 @@ abstract class FlutterTestDriver {
// This class doesn't use the result of the future. It's made available // This class doesn't use the result of the future. It's made available
// via a getter for external uses. // via a getter for external uses.
_process.exitCode.then((int code) { // ignore: unawaited_futures unawaited(_process.exitCode.then((int code) {
_debugPrint('Process exited ($code)'); _debugPrint('Process exited ($code)');
_hasExited = true; _hasExited = true;
}); }));
transformToLines(_process.stdout).listen((String line) => _stdout.add(line)); transformToLines(_process.stdout).listen((String line) => _stdout.add(line));
transformToLines(_process.stderr).listen((String line) => _stderr.add(line)); transformToLines(_process.stderr).listen((String line) => _stderr.add(line));
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:flutter_tools/src/base/common.dart';
Process daemon; Process daemon;
// To use, start from the console and enter: // To use, start from the console and enter:
...@@ -82,10 +83,10 @@ Future<void> main() async { ...@@ -82,10 +83,10 @@ Future<void> main() async {
}); });
// Print in the callback can't fail. // Print in the callback can't fail.
daemon.exitCode.then<void>((int code) { // ignore: unawaited_futures unawaited(daemon.exitCode.then<void>((int code) {
print('daemon exiting ($code)'); print('daemon exiting ($code)');
exit(code); exit(code);
}); }));
} }
int id = 0; int id = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment