[flutter_tools] do not measure progress timeout (#67959)
Remove "This is taking a long time" progress timeout and TimeoutConfiguration.
This commit is contained in:
parent
3e0d2741de
commit
9e70180f63
@ -143,7 +143,6 @@ Future<void> main(List<String> args) async {
|
||||
outputPreferences: globals.outputPreferences,
|
||||
terminal: globals.terminal,
|
||||
stdio: globals.stdio,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
);
|
||||
return loggerFactory.createLogger(
|
||||
daemon: daemon,
|
||||
@ -163,17 +162,14 @@ class LoggerFactory {
|
||||
@required Terminal terminal,
|
||||
@required Stdio stdio,
|
||||
@required OutputPreferences outputPreferences,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
StopwatchFactory stopwatchFactory = const StopwatchFactory(),
|
||||
}) : _terminal = terminal,
|
||||
_stdio = stdio,
|
||||
_timeoutConfiguration = timeoutConfiguration,
|
||||
_stopwatchFactory = stopwatchFactory,
|
||||
_outputPreferences = outputPreferences;
|
||||
|
||||
final Terminal _terminal;
|
||||
final Stdio _stdio;
|
||||
final TimeoutConfiguration _timeoutConfiguration;
|
||||
final StopwatchFactory _stopwatchFactory;
|
||||
final OutputPreferences _outputPreferences;
|
||||
|
||||
@ -190,7 +186,6 @@ class LoggerFactory {
|
||||
terminal: _terminal,
|
||||
stdio: _stdio,
|
||||
outputPreferences: _outputPreferences,
|
||||
timeoutConfiguration: _timeoutConfiguration,
|
||||
stopwatchFactory: _stopwatchFactory,
|
||||
);
|
||||
} else {
|
||||
@ -198,7 +193,6 @@ class LoggerFactory {
|
||||
terminal: _terminal,
|
||||
stdio: _stdio,
|
||||
outputPreferences: _outputPreferences,
|
||||
timeoutConfiguration: _timeoutConfiguration,
|
||||
stopwatchFactory: _stopwatchFactory
|
||||
);
|
||||
}
|
||||
|
@ -63,7 +63,6 @@ class AndroidDevice extends Device {
|
||||
@required Platform platform,
|
||||
@required AndroidSdk androidSdk,
|
||||
@required FileSystem fileSystem,
|
||||
TimeoutConfiguration timeoutConfiguration = const TimeoutConfiguration(),
|
||||
AndroidConsoleSocketFactory androidConsoleSocketFactory = kAndroidConsoleSocketFactory,
|
||||
}) : _logger = logger,
|
||||
_processManager = processManager,
|
||||
@ -71,7 +70,6 @@ class AndroidDevice extends Device {
|
||||
_platform = platform,
|
||||
_fileSystem = fileSystem,
|
||||
_androidConsoleSocketFactory = androidConsoleSocketFactory,
|
||||
_timeoutConfiguration = timeoutConfiguration,
|
||||
_processUtils = ProcessUtils(logger: logger, processManager: processManager),
|
||||
super(
|
||||
id,
|
||||
@ -87,7 +85,6 @@ class AndroidDevice extends Device {
|
||||
final FileSystem _fileSystem;
|
||||
final ProcessUtils _processUtils;
|
||||
final AndroidConsoleSocketFactory _androidConsoleSocketFactory;
|
||||
final TimeoutConfiguration _timeoutConfiguration;
|
||||
|
||||
final String productID;
|
||||
final String modelID;
|
||||
@ -176,12 +173,12 @@ class AndroidDevice extends Device {
|
||||
try {
|
||||
await console
|
||||
.connect()
|
||||
.timeout(_timeoutConfiguration.fastOperation,
|
||||
.timeout(const Duration(seconds: 2),
|
||||
onTimeout: () => throw TimeoutException('Connection timed out'));
|
||||
|
||||
return await console
|
||||
.getAvdName()
|
||||
.timeout(_timeoutConfiguration.fastOperation,
|
||||
.timeout(const Duration(seconds: 2),
|
||||
onTimeout: () => throw TimeoutException('"avd name" timed out'));
|
||||
} finally {
|
||||
console.destroy();
|
||||
@ -443,7 +440,6 @@ class AndroidDevice extends Device {
|
||||
|
||||
final Status status = _logger.startProgress(
|
||||
'Installing ${_fileSystem.path.relative(app.file.path)}...',
|
||||
timeout: _timeoutConfiguration.slowOperation,
|
||||
);
|
||||
final RunResult installResult = await _processUtils.run(
|
||||
adbCommandForDevice(<String>[
|
||||
|
@ -177,7 +177,6 @@ class AndroidDevices extends PollingDeviceDiscovery {
|
||||
logger: _logger,
|
||||
platform: _platform,
|
||||
processManager: _processManager,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
));
|
||||
}
|
||||
} else {
|
||||
|
@ -136,7 +136,6 @@ Future<File> getGradleAppOut(AndroidProject androidProject) async {
|
||||
Future<void> checkGradleDependencies() async {
|
||||
final Status progress = globals.logger.startProgress(
|
||||
'Ensuring gradle dependencies are up to date...',
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
);
|
||||
final FlutterProject flutterProject = FlutterProject.current();
|
||||
await processUtils.run(<String>[
|
||||
@ -167,8 +166,7 @@ void createSettingsAarGradle(Directory androidDirectory) {
|
||||
final String currentFileContent = currentSettingsFile.readAsStringSync();
|
||||
|
||||
final String newSettingsRelativeFile = globals.fs.path.relative(newSettingsFile.path);
|
||||
final Status status = globals.logger.startProgress('✏️ Creating `$newSettingsRelativeFile`...',
|
||||
timeout: timeoutConfiguration.fastOperation);
|
||||
final Status status = globals.logger.startProgress('✏️ Creating `$newSettingsRelativeFile`...');
|
||||
|
||||
final String flutterRoot = globals.fs.path.absolute(Cache.flutterRoot);
|
||||
final File legacySettingsDotGradleFiles = globals.fs.file(globals.fs.path.join(flutterRoot, 'packages','flutter_tools',
|
||||
@ -270,7 +268,6 @@ Future<void> buildGradleApp({
|
||||
|
||||
final Status status = globals.logger.startProgress(
|
||||
"Running Gradle task '$assembleTask'...",
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
multilineOutput: true,
|
||||
);
|
||||
|
||||
@ -571,7 +568,6 @@ Future<void> buildGradleAar({
|
||||
final String aarTask = getAarTaskFor(buildInfo);
|
||||
final Status status = globals.logger.startProgress(
|
||||
"Running Gradle task '$aarTask'...",
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
multilineOutput: true,
|
||||
);
|
||||
|
||||
|
@ -69,7 +69,6 @@ class AotBuilder {
|
||||
final String typeName = globals.artifacts.getEngineType(platform, buildInfo.mode);
|
||||
status = globals.logger.startProgress(
|
||||
'Building AOT snapshot in ${getFriendlyModeName(buildInfo.mode)} mode ($typeName)...',
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import '../base/context.dart';
|
||||
import '../convert.dart';
|
||||
import '../globals.dart' as globals;
|
||||
import 'io.dart';
|
||||
@ -14,13 +13,6 @@ import 'terminal.dart' show AnsiTerminal, Terminal, TerminalColor, OutputPrefere
|
||||
import 'utils.dart';
|
||||
|
||||
const int kDefaultStatusPadding = 59;
|
||||
const Duration _kFastOperation = Duration(seconds: 2);
|
||||
const Duration _kSlowOperation = Duration(minutes: 2);
|
||||
|
||||
/// The [TimeoutConfiguration] instance.
|
||||
///
|
||||
/// If not provided via injection, a default instance is provided.
|
||||
TimeoutConfiguration get timeoutConfiguration => context.get<TimeoutConfiguration>() ?? const TimeoutConfiguration();
|
||||
|
||||
/// A factory for generating [Stopwatch] instances for [Status] instances.
|
||||
class StopwatchFactory {
|
||||
@ -31,22 +23,6 @@ class StopwatchFactory {
|
||||
Stopwatch createStopwatch() => Stopwatch();
|
||||
}
|
||||
|
||||
class TimeoutConfiguration {
|
||||
const TimeoutConfiguration();
|
||||
|
||||
/// The expected time that various "slow" operations take, such as running
|
||||
/// the analyzer.
|
||||
///
|
||||
/// Defaults to 2 minutes.
|
||||
Duration get slowOperation => _kSlowOperation;
|
||||
|
||||
/// The expected time that various "fast" operations take, such as a hot
|
||||
/// reload.
|
||||
///
|
||||
/// Defaults to 2 seconds.
|
||||
Duration get fastOperation => _kFastOperation;
|
||||
}
|
||||
|
||||
typedef VoidCallback = void Function();
|
||||
|
||||
abstract class Logger {
|
||||
@ -62,8 +38,6 @@ abstract class Logger {
|
||||
|
||||
OutputPreferences get _outputPreferences;
|
||||
|
||||
TimeoutConfiguration get _timeoutConfiguration;
|
||||
|
||||
/// Display an error `message` to the user. Commands should use this if they
|
||||
/// fail in some way.
|
||||
///
|
||||
@ -144,12 +118,6 @@ abstract class Logger {
|
||||
///
|
||||
/// The `message` argument is the message to display to the user.
|
||||
///
|
||||
/// The `timeout` argument sets a duration after which an additional message
|
||||
/// may be shown saying that the operation is taking a long time. (Not all
|
||||
/// [Status] subclasses show such a message.) Set this to null if the
|
||||
/// operation can legitimately take an arbitrary amount of time (e.g. waiting
|
||||
/// for the user).
|
||||
///
|
||||
/// The `progressId` argument provides an ID that can be used to identify
|
||||
/// this type of progress (e.g. `hot.reload`, `hot.restart`).
|
||||
///
|
||||
@ -157,7 +125,6 @@ abstract class Logger {
|
||||
/// between the `message` and the progress indicator, if any.
|
||||
Status startProgress(
|
||||
String message, {
|
||||
@required Duration timeout,
|
||||
String progressId,
|
||||
bool multilineOutput = false,
|
||||
int progressIndicatorPadding = kDefaultStatusPadding,
|
||||
@ -198,9 +165,6 @@ class DelegatingLogger implements Logger {
|
||||
@override
|
||||
OutputPreferences get _outputPreferences => _delegate._outputPreferences;
|
||||
|
||||
@override
|
||||
TimeoutConfiguration get _timeoutConfiguration => _delegate._timeoutConfiguration;
|
||||
|
||||
@override
|
||||
bool get isVerbose => _delegate.isVerbose;
|
||||
|
||||
@ -240,9 +204,8 @@ class DelegatingLogger implements Logger {
|
||||
}
|
||||
|
||||
@override
|
||||
Status startProgress(String message, {Duration timeout, String progressId, bool multilineOutput = false, int progressIndicatorPadding = kDefaultStatusPadding}) {
|
||||
Status startProgress(String message, {String progressId, bool multilineOutput = false, int progressIndicatorPadding = kDefaultStatusPadding}) {
|
||||
return _delegate.startProgress(message,
|
||||
timeout: timeout,
|
||||
progressId: progressId,
|
||||
multilineOutput: multilineOutput,
|
||||
progressIndicatorPadding: progressIndicatorPadding,
|
||||
@ -279,12 +242,10 @@ class StdoutLogger extends Logger {
|
||||
@required Terminal terminal,
|
||||
@required Stdio stdio,
|
||||
@required OutputPreferences outputPreferences,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
StopwatchFactory stopwatchFactory = const StopwatchFactory(),
|
||||
})
|
||||
: _stdio = stdio,
|
||||
_terminal = terminal,
|
||||
_timeoutConfiguration = timeoutConfiguration,
|
||||
_outputPreferences = outputPreferences,
|
||||
_stopwatchFactory = stopwatchFactory;
|
||||
|
||||
@ -292,8 +253,6 @@ class StdoutLogger extends Logger {
|
||||
final Terminal _terminal;
|
||||
@override
|
||||
final OutputPreferences _outputPreferences;
|
||||
@override
|
||||
final TimeoutConfiguration _timeoutConfiguration;
|
||||
final Stdio _stdio;
|
||||
final StopwatchFactory _stopwatchFactory;
|
||||
|
||||
@ -380,7 +339,6 @@ class StdoutLogger extends Logger {
|
||||
@override
|
||||
Status startProgress(
|
||||
String message, {
|
||||
@required Duration timeout,
|
||||
String progressId,
|
||||
bool multilineOutput = false,
|
||||
int progressIndicatorPadding = kDefaultStatusPadding,
|
||||
@ -389,32 +347,26 @@ class StdoutLogger extends Logger {
|
||||
if (_status != null) {
|
||||
// Ignore nested progresses; return a no-op status object.
|
||||
return SilentStatus(
|
||||
timeout: timeout,
|
||||
onFinish: _clearStatus,
|
||||
timeoutConfiguration: _timeoutConfiguration,
|
||||
stopwatch: _stopwatchFactory.createStopwatch(),
|
||||
)..start();
|
||||
}
|
||||
if (supportsColor) {
|
||||
_status = AnsiStatus(
|
||||
message: message,
|
||||
timeout: timeout,
|
||||
multilineOutput: multilineOutput,
|
||||
padding: progressIndicatorPadding,
|
||||
onFinish: _clearStatus,
|
||||
stdio: _stdio,
|
||||
timeoutConfiguration: _timeoutConfiguration,
|
||||
stopwatch: _stopwatchFactory.createStopwatch(),
|
||||
terminal: _terminal,
|
||||
)..start();
|
||||
} else {
|
||||
_status = SummaryStatus(
|
||||
message: message,
|
||||
timeout: timeout,
|
||||
padding: progressIndicatorPadding,
|
||||
onFinish: _clearStatus,
|
||||
stdio: _stdio,
|
||||
timeoutConfiguration: _timeoutConfiguration,
|
||||
stopwatch: _stopwatchFactory.createStopwatch(),
|
||||
)..start();
|
||||
}
|
||||
@ -449,13 +401,11 @@ class WindowsStdoutLogger extends StdoutLogger {
|
||||
@required Terminal terminal,
|
||||
@required Stdio stdio,
|
||||
@required OutputPreferences outputPreferences,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
StopwatchFactory stopwatchFactory = const StopwatchFactory(),
|
||||
}) : super(
|
||||
terminal: terminal,
|
||||
stdio: stdio,
|
||||
outputPreferences: outputPreferences,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatchFactory: stopwatchFactory,
|
||||
);
|
||||
|
||||
@ -477,11 +427,9 @@ class BufferLogger extends Logger {
|
||||
BufferLogger({
|
||||
@required AnsiTerminal terminal,
|
||||
@required OutputPreferences outputPreferences,
|
||||
TimeoutConfiguration timeoutConfiguration = const TimeoutConfiguration(),
|
||||
StopwatchFactory stopwatchFactory = const StopwatchFactory(),
|
||||
}) : _outputPreferences = outputPreferences,
|
||||
_terminal = terminal,
|
||||
_timeoutConfiguration = timeoutConfiguration,
|
||||
_stopwatchFactory = stopwatchFactory;
|
||||
|
||||
/// Create a [BufferLogger] with test preferences.
|
||||
@ -490,7 +438,6 @@ class BufferLogger extends Logger {
|
||||
OutputPreferences outputPreferences,
|
||||
}) : _terminal = terminal ?? Terminal.test(),
|
||||
_outputPreferences = outputPreferences ?? OutputPreferences.test(),
|
||||
_timeoutConfiguration = const TimeoutConfiguration(),
|
||||
_stopwatchFactory = const StopwatchFactory();
|
||||
|
||||
|
||||
@ -500,9 +447,6 @@ class BufferLogger extends Logger {
|
||||
@override
|
||||
final Terminal _terminal;
|
||||
|
||||
@override
|
||||
final TimeoutConfiguration _timeoutConfiguration;
|
||||
|
||||
final StopwatchFactory _stopwatchFactory;
|
||||
|
||||
@override
|
||||
@ -578,7 +522,6 @@ class BufferLogger extends Logger {
|
||||
@override
|
||||
Status startProgress(
|
||||
String message, {
|
||||
@required Duration timeout,
|
||||
String progressId,
|
||||
bool multilineOutput = false,
|
||||
int progressIndicatorPadding = kDefaultStatusPadding,
|
||||
@ -586,8 +529,6 @@ class BufferLogger extends Logger {
|
||||
assert(progressIndicatorPadding != null);
|
||||
printStatus(message);
|
||||
return SilentStatus(
|
||||
timeout: timeout,
|
||||
timeoutConfiguration: _timeoutConfiguration,
|
||||
stopwatch: _stopwatchFactory.createStopwatch(),
|
||||
)..start();
|
||||
}
|
||||
@ -673,7 +614,6 @@ class VerboseLogger extends DelegatingLogger {
|
||||
@override
|
||||
Status startProgress(
|
||||
String message, {
|
||||
@required Duration timeout,
|
||||
String progressId,
|
||||
bool multilineOutput = false,
|
||||
int progressIndicatorPadding = kDefaultStatusPadding,
|
||||
@ -682,22 +622,16 @@ class VerboseLogger extends DelegatingLogger {
|
||||
printStatus(message);
|
||||
final Stopwatch timer = _stopwatchFactory.createStopwatch()..start();
|
||||
return SilentStatus(
|
||||
timeout: timeout,
|
||||
timeoutConfiguration: _timeoutConfiguration,
|
||||
// This is intentionally a different stopwatch than above.
|
||||
stopwatch: _stopwatchFactory.createStopwatch(),
|
||||
onFinish: () {
|
||||
String time;
|
||||
if (timeout == null || timeout > _timeoutConfiguration.fastOperation) {
|
||||
if (timer.elapsed.inSeconds > 2) {
|
||||
time = getElapsedAsSeconds(timer.elapsed);
|
||||
} else {
|
||||
time = getElapsedAsMilliseconds(timer.elapsed);
|
||||
}
|
||||
if (timeout != null && timer.elapsed > timeout) {
|
||||
printTrace('$message (completed in $time, longer than expected)');
|
||||
} else {
|
||||
printTrace('$message (completed in $time)');
|
||||
}
|
||||
printTrace('$message (completed in $time)');
|
||||
},
|
||||
)..start();
|
||||
}
|
||||
@ -748,9 +682,6 @@ typedef SlowWarningCallback = String Function();
|
||||
/// A [Status] class begins when start is called, and may produce progress
|
||||
/// information asynchronously.
|
||||
///
|
||||
/// Some subclasses change output once [timeout] has expired, to indicate that
|
||||
/// something is taking longer than expected.
|
||||
///
|
||||
/// The [SilentStatus] class never has any output.
|
||||
///
|
||||
/// The [AnsiSpinner] subclass shows a spinner, and replaces it with a single
|
||||
@ -767,55 +698,38 @@ typedef SlowWarningCallback = String Function();
|
||||
/// a [Status] or one of its subclasses.
|
||||
abstract class Status {
|
||||
Status({
|
||||
@required this.timeout,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
this.onFinish,
|
||||
@required Stopwatch stopwatch,
|
||||
}) : _timeoutConfiguration = timeoutConfiguration,
|
||||
_stopwatch = stopwatch;
|
||||
}) : _stopwatch = stopwatch;
|
||||
|
||||
/// A [SilentStatus] or an [AnsiSpinner] (depending on whether the
|
||||
/// terminal is fancy enough), already started.
|
||||
factory Status.withSpinner({
|
||||
@required Duration timeout,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
@required Stopwatch stopwatch,
|
||||
@required Terminal terminal,
|
||||
VoidCallback onFinish,
|
||||
SlowWarningCallback slowWarningCallback,
|
||||
}) {
|
||||
if (terminal.supportsColor) {
|
||||
return AnsiSpinner(
|
||||
timeout: timeout,
|
||||
onFinish: onFinish,
|
||||
slowWarningCallback: slowWarningCallback,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: stopwatch,
|
||||
terminal: terminal,
|
||||
)..start();
|
||||
}
|
||||
return SilentStatus(
|
||||
timeout: timeout,
|
||||
onFinish: onFinish,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: stopwatch,
|
||||
)..start();
|
||||
}
|
||||
|
||||
final Duration timeout;
|
||||
final VoidCallback onFinish;
|
||||
final TimeoutConfiguration _timeoutConfiguration;
|
||||
|
||||
@protected
|
||||
final Stopwatch _stopwatch;
|
||||
|
||||
@protected
|
||||
@visibleForTesting
|
||||
bool get seemsSlow => timeout != null && _stopwatch.elapsed > timeout;
|
||||
|
||||
@protected
|
||||
String get elapsedTime {
|
||||
if (timeout == null || timeout > _timeoutConfiguration.fastOperation) {
|
||||
if (_stopwatch.elapsed.inSeconds > 2) {
|
||||
return getElapsedAsSeconds(_stopwatch.elapsed);
|
||||
}
|
||||
return getElapsedAsMilliseconds(_stopwatch.elapsed);
|
||||
@ -856,14 +770,10 @@ abstract class Status {
|
||||
/// A [SilentStatus] shows nothing.
|
||||
class SilentStatus extends Status {
|
||||
SilentStatus({
|
||||
@required Duration timeout,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
@required Stopwatch stopwatch,
|
||||
VoidCallback onFinish,
|
||||
}) : super(
|
||||
timeout: timeout,
|
||||
onFinish: onFinish,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: stopwatch,
|
||||
);
|
||||
|
||||
@ -880,8 +790,6 @@ class SilentStatus extends Status {
|
||||
class SummaryStatus extends Status {
|
||||
SummaryStatus({
|
||||
this.message = '',
|
||||
@required Duration timeout,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
@required Stopwatch stopwatch,
|
||||
this.padding = kDefaultStatusPadding,
|
||||
VoidCallback onFinish,
|
||||
@ -890,9 +798,7 @@ class SummaryStatus extends Status {
|
||||
assert(padding != null),
|
||||
_stdio = stdio ?? globals.stdio,
|
||||
super(
|
||||
timeout: timeout,
|
||||
onFinish: onFinish,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: stopwatch,
|
||||
);
|
||||
|
||||
@ -935,18 +841,9 @@ class SummaryStatus extends Status {
|
||||
}
|
||||
|
||||
/// Prints a (minimum) 8 character padded time.
|
||||
///
|
||||
/// If [timeout] is less than or equal to [kFastOperation], the time is in
|
||||
/// seconds; otherwise, milliseconds. If the time is longer than [timeout],
|
||||
/// appends "(!)" to the time.
|
||||
///
|
||||
/// Examples: ` 0.5s`, ` 150ms`, ` 1,600ms`, ` 3.1s (!)`
|
||||
void writeSummaryInformation() {
|
||||
assert(_messageShowingOnCurrentLine);
|
||||
_writeToStdOut(elapsedTime.padLeft(_kTimePadding));
|
||||
if (seemsSlow) {
|
||||
_writeToStdOut(' (!)');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@ -959,24 +856,16 @@ class SummaryStatus extends Status {
|
||||
|
||||
/// An [AnsiSpinner] is a simple animation that does nothing but implement a
|
||||
/// terminal spinner. When stopped or canceled, the animation erases itself.
|
||||
///
|
||||
/// If the timeout expires, a customizable warning is shown (but the spinner
|
||||
/// continues otherwise unabated).
|
||||
class AnsiSpinner extends Status {
|
||||
AnsiSpinner({
|
||||
@required Duration timeout,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
@required Stopwatch stopwatch,
|
||||
@required Terminal terminal,
|
||||
VoidCallback onFinish,
|
||||
this.slowWarningCallback,
|
||||
Stdio stdio,
|
||||
}) : _stdio = stdio ?? globals.stdio,
|
||||
_terminal = terminal,
|
||||
super(
|
||||
timeout: timeout,
|
||||
onFinish: onFinish,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: stopwatch,
|
||||
);
|
||||
|
||||
@ -995,13 +884,8 @@ class AnsiSpinner extends Status {
|
||||
? const <String>[r'-', r'\', r'|', r'/']
|
||||
: const <String>['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷'];
|
||||
|
||||
static const String _defaultSlowWarning = '(This is taking an unexpectedly long time.)';
|
||||
final SlowWarningCallback slowWarningCallback;
|
||||
|
||||
String _slowWarning = '';
|
||||
|
||||
String get _currentAnimationFrame => _animation[ticks % _animation.length];
|
||||
int get _currentLength => _currentAnimationFrame.length + _slowWarning.length;
|
||||
int get _currentLength => _currentAnimationFrame.length;
|
||||
String get _backspace => _backspaceChar * (spinnerIndent + _currentLength);
|
||||
String get _clear => _clearChar * (spinnerIndent + _currentLength);
|
||||
|
||||
@ -1029,18 +913,6 @@ class AnsiSpinner extends Status {
|
||||
assert(timer.isActive);
|
||||
_writeToStdOut(_backspace);
|
||||
ticks += 1;
|
||||
if (seemsSlow) {
|
||||
if (!timedOut) {
|
||||
timedOut = true;
|
||||
_writeToStdOut('$_clear\n');
|
||||
}
|
||||
if (slowWarningCallback != null) {
|
||||
_slowWarning = slowWarningCallback();
|
||||
} else {
|
||||
_slowWarning = _defaultSlowWarning;
|
||||
}
|
||||
_writeToStdOut(_slowWarning);
|
||||
}
|
||||
_writeToStdOut('${_clearChar * spinnerIndent}$_currentAnimationFrame');
|
||||
}
|
||||
|
||||
@ -1087,20 +959,16 @@ class AnsiStatus extends AnsiSpinner {
|
||||
this.message = '',
|
||||
this.multilineOutput = false,
|
||||
this.padding = kDefaultStatusPadding,
|
||||
@required Duration timeout,
|
||||
@required Stopwatch stopwatch,
|
||||
@required Terminal terminal,
|
||||
VoidCallback onFinish,
|
||||
Stdio stdio,
|
||||
TimeoutConfiguration timeoutConfiguration,
|
||||
}) : assert(message != null),
|
||||
assert(multilineOutput != null),
|
||||
assert(padding != null),
|
||||
super(
|
||||
timeout: timeout,
|
||||
onFinish: onFinish,
|
||||
stdio: stdio,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: stopwatch,
|
||||
terminal: terminal,
|
||||
);
|
||||
@ -1152,9 +1020,6 @@ class AnsiStatus extends AnsiSpinner {
|
||||
_writeToStdOut('\n${'$message Done'.padRight(padding)}$_margin');
|
||||
}
|
||||
_writeToStdOut(elapsedTime.padLeft(_kTimePadding));
|
||||
if (seemsSlow) {
|
||||
_writeToStdOut(' (!)');
|
||||
}
|
||||
}
|
||||
|
||||
void _clearStatus() {
|
||||
|
@ -538,7 +538,6 @@ class Cache {
|
||||
Future<bool> doesRemoteExist(String message, Uri url) async {
|
||||
final Status status = _logger.startProgress(
|
||||
message,
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
);
|
||||
bool exists;
|
||||
try {
|
||||
@ -1079,8 +1078,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
|
||||
);
|
||||
gradleUtils.injectGradleWrapperIfNeeded(tempDir);
|
||||
|
||||
final Status status = globals.logger.startProgress('Downloading Android Maven dependencies...',
|
||||
timeout: timeoutConfiguration.slowOperation);
|
||||
final Status status = globals.logger.startProgress('Downloading Android Maven dependencies...');
|
||||
final File gradle = tempDir.childFile(
|
||||
globals.platform.isWindows ? 'gradlew.bat' : 'gradlew',
|
||||
);
|
||||
@ -1597,7 +1595,6 @@ class ArtifactUpdater {
|
||||
while (retries > 0) {
|
||||
status = _logger.startProgress(
|
||||
message,
|
||||
timeout: null, // This will take a variable amount of time based on network connectivity.
|
||||
);
|
||||
try {
|
||||
_ensureExists(tempFile.parent);
|
||||
|
@ -102,7 +102,7 @@ class AnalyzeContinuously extends AnalyzeBase {
|
||||
if (!firstAnalysis) {
|
||||
logger.printStatus('\n');
|
||||
}
|
||||
analysisStatus = logger.startProgress('Analyzing $analysisTarget...', timeout: timeoutConfiguration.slowOperation);
|
||||
analysisStatus = logger.startProgress('Analyzing $analysisTarget...');
|
||||
analyzedPaths.clear();
|
||||
analysisTimer = Stopwatch()..start();
|
||||
} else {
|
||||
|
@ -137,7 +137,6 @@ class AnalyzeOnce extends AnalyzeBase {
|
||||
progress = argResults['preamble'] as bool
|
||||
? logger.startProgress(
|
||||
'Analyzing $message...',
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
)
|
||||
: null;
|
||||
|
||||
|
@ -207,7 +207,7 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
|
||||
}
|
||||
|
||||
final Status status = globals.logger.startProgress(
|
||||
' └─Moving to ${globals.fs.path.relative(modeDirectory.path)}', timeout: timeoutConfiguration.slowOperation);
|
||||
' └─Moving to ${globals.fs.path.relative(modeDirectory.path)}');
|
||||
try {
|
||||
// Delete the intermediaries since they would have been copied into our
|
||||
// output frameworks.
|
||||
@ -230,7 +230,7 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
|
||||
/// vendored framework caching.
|
||||
@visibleForTesting
|
||||
void produceFlutterPodspec(BuildMode mode, Directory modeDirectory, { bool force = false }) {
|
||||
final Status status = globals.logger.startProgress(' ├─Creating Flutter.podspec...', timeout: timeoutConfiguration.fastOperation);
|
||||
final Status status = globals.logger.startProgress(' ├─Creating Flutter.podspec...');
|
||||
try {
|
||||
final GitTagVersion gitTagVersion = _flutterVersion.gitTagVersion;
|
||||
if (!force && (gitTagVersion.x == null || gitTagVersion.y == null || gitTagVersion.z == null || gitTagVersion.commits != 0)) {
|
||||
@ -290,7 +290,6 @@ end
|
||||
) async {
|
||||
final Status status = globals.logger.startProgress(
|
||||
' ├─Populating Flutter.framework...',
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
);
|
||||
final String engineCacheFlutterFrameworkDirectory = globals.artifacts.getArtifactPath(
|
||||
Artifact.flutterFramework,
|
||||
@ -347,7 +346,6 @@ end
|
||||
|
||||
final Status status = globals.logger.startProgress(
|
||||
' ├─Building App.framework...',
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
);
|
||||
try {
|
||||
Target target;
|
||||
@ -411,7 +409,8 @@ end
|
||||
Directory outputDirectory,
|
||||
) async {
|
||||
final Status status = globals.logger.startProgress(
|
||||
' ├─Building plugins...', timeout: timeoutConfiguration.slowOperation);
|
||||
' ├─Building plugins...'
|
||||
);
|
||||
try {
|
||||
// Regardless of the last "flutter build" build mode,
|
||||
// copy the corresponding engine.
|
||||
@ -572,7 +571,6 @@ end
|
||||
|
||||
final Status status = globals.logger.startProgress(
|
||||
' ├─Creating $frameworkBinaryName.xcframework...',
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
);
|
||||
try {
|
||||
if (buildInfo.mode == BuildMode.debug) {
|
||||
|
@ -67,7 +67,6 @@ class CleanCommand extends FlutterCommand {
|
||||
}
|
||||
final Status xcodeStatus = globals.logger.startProgress(
|
||||
'Cleaning Xcode workspace...',
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
);
|
||||
try {
|
||||
final Directory xcodeWorkspace = xcodeProject.xcodeWorkspace;
|
||||
@ -95,7 +94,6 @@ class CleanCommand extends FlutterCommand {
|
||||
}
|
||||
final Status deletionStatus = globals.logger.startProgress(
|
||||
'Deleting ${file.basename}...',
|
||||
timeout: timeoutConfiguration.fastOperation,
|
||||
);
|
||||
try {
|
||||
file.deleteSync(recursive: true);
|
||||
|
@ -1025,8 +1025,6 @@ class NotifyingLogger extends DelegatingLogger {
|
||||
assert(timeout != null);
|
||||
printStatus(message);
|
||||
return SilentStatus(
|
||||
timeout: timeout,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: Stopwatch(),
|
||||
);
|
||||
}
|
||||
@ -1161,8 +1159,6 @@ class AppRunLogger extends DelegatingLogger {
|
||||
);
|
||||
|
||||
_status = SilentStatus(
|
||||
timeout: timeout,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
onFinish: () {
|
||||
_status = null;
|
||||
_sendProgressEvent(
|
||||
|
@ -146,7 +146,6 @@ class UpdatePackagesCommand extends FlutterCommand {
|
||||
Future<void> _downloadCoverageData() async {
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Downloading lcov data for package:flutter...',
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
);
|
||||
final String urlBase = globals.platform.environment['FLUTTER_STORAGE_BASE_URL'] ?? 'https://storage.googleapis.com';
|
||||
final Uri coverageUri = Uri.parse('$urlBase/flutter_infra/flutter/coverage/lcov.info');
|
||||
|
@ -111,7 +111,6 @@ Future<T> runInContext<T>(
|
||||
logger: globals.logger,
|
||||
platform: globals.platform,
|
||||
xcodeProjectInterpreter: globals.xcodeProjectInterpreter,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
),
|
||||
CocoaPodsValidator: () => CocoaPodsValidator(
|
||||
globals.cocoaPods,
|
||||
@ -197,13 +196,11 @@ Future<T> runInContext<T>(
|
||||
terminal: globals.terminal,
|
||||
stdio: globals.stdio,
|
||||
outputPreferences: globals.outputPreferences,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
)
|
||||
: StdoutLogger(
|
||||
terminal: globals.terminal,
|
||||
stdio: globals.stdio,
|
||||
outputPreferences: globals.outputPreferences,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
),
|
||||
MacOSWorkflow: () => MacOSWorkflow(
|
||||
featureFlags: featureFlags,
|
||||
@ -243,7 +240,6 @@ Future<T> runInContext<T>(
|
||||
ShutdownHooks: () => ShutdownHooks(logger: globals.logger),
|
||||
Stdio: () => Stdio(),
|
||||
SystemClock: () => const SystemClock(),
|
||||
TimeoutConfiguration: () => const TimeoutConfiguration(),
|
||||
Usage: () => Usage(
|
||||
runningOnBot: runningOnBot,
|
||||
),
|
||||
|
@ -198,7 +198,6 @@ class _DefaultPub implements Pub {
|
||||
final String command = upgrade ? 'upgrade' : 'get';
|
||||
final Status status = _logger.startProgress(
|
||||
'Running "flutter pub $command" in ${_fileSystem.path.basename(directory)}...',
|
||||
timeout: const TimeoutConfiguration().slowOperation,
|
||||
);
|
||||
final bool verbose = _logger.isVerbose;
|
||||
final List<String> args = <String>[
|
||||
|
@ -301,9 +301,6 @@ class Doctor {
|
||||
for (final ValidatorTask validatorTask in startValidatorTasks()) {
|
||||
final DoctorValidator validator = validatorTask.validator;
|
||||
final Status status = Status.withSpinner(
|
||||
timeout: timeoutConfiguration.fastOperation,
|
||||
slowWarningCallback: () => validator.slowWarning,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: Stopwatch(),
|
||||
terminal: globals.terminal,
|
||||
);
|
||||
|
@ -103,7 +103,6 @@ Future<void> _genSnapshot(
|
||||
int result;
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Compiling Fuchsia application to native code...',
|
||||
timeout: null,
|
||||
);
|
||||
try {
|
||||
result = await processUtils.stream(command, trace: true);
|
||||
|
@ -328,7 +328,6 @@ class FuchsiaDevice extends Device {
|
||||
final String appName = FlutterProject.current().manifest.appName;
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Starting Fuchsia application $appName...',
|
||||
timeout: null,
|
||||
);
|
||||
FuchsiaPackageServer fuchsiaPackageServer;
|
||||
bool serverRegistered = false;
|
||||
@ -756,7 +755,6 @@ class FuchsiaIsolateDiscoveryProtocol {
|
||||
}
|
||||
_status ??= globals.logger.startProgress(
|
||||
'Waiting for a connection from $_isolateName on ${_device.name}...',
|
||||
timeout: null, // could take an arbitrary amount of time
|
||||
);
|
||||
unawaited(_findIsolate()); // Completes the _foundUri Future.
|
||||
return _foundUri.future.then((Uri uri) {
|
||||
|
@ -71,7 +71,6 @@ class FuchsiaKernelCompiler {
|
||||
];
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Building Fuchsia application...',
|
||||
timeout: null,
|
||||
);
|
||||
int result;
|
||||
try {
|
||||
|
@ -395,8 +395,8 @@ class IOSDevice extends Device {
|
||||
];
|
||||
|
||||
final Status installStatus = _logger.startProgress(
|
||||
'Installing and launching...',
|
||||
timeout: timeoutConfiguration.slowOperation);
|
||||
'Installing and launching...',
|
||||
);
|
||||
try {
|
||||
ProtocolDiscovery observatoryDiscovery;
|
||||
int installationResult = 1;
|
||||
|
@ -302,7 +302,6 @@ Future<XcodeBuildResult> buildXcodeProject({
|
||||
initialBuildStatus = null;
|
||||
buildSubStatus = globals.logger.startProgress(
|
||||
line,
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
progressIndicatorPadding: kDefaultStatusPadding - 7,
|
||||
);
|
||||
}
|
||||
@ -331,7 +330,7 @@ Future<XcodeBuildResult> buildXcodeProject({
|
||||
}
|
||||
|
||||
final Stopwatch sw = Stopwatch()..start();
|
||||
initialBuildStatus = globals.logger.startProgress('Running Xcode build...', timeout: timeoutConfiguration.slowOperation);
|
||||
initialBuildStatus = globals.logger.startProgress('Running Xcode build...');
|
||||
|
||||
final RunResult buildResult = await _runBuildWithRetries(buildCommands, app);
|
||||
|
||||
|
@ -327,8 +327,6 @@ class XcodeProjectInterpreter {
|
||||
Duration timeout = const Duration(minutes: 1),
|
||||
}) async {
|
||||
final Status status = Status.withSpinner(
|
||||
timeout: const TimeoutConfiguration().fastOperation,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
stopwatch: Stopwatch(),
|
||||
terminal: _terminal,
|
||||
);
|
||||
|
@ -576,9 +576,6 @@ class _ResidentWebRunner extends ResidentWebRunner {
|
||||
final Stopwatch timer = Stopwatch()..start();
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Performing hot restart...',
|
||||
timeout: supportsServiceProtocol
|
||||
? timeoutConfiguration.fastOperation
|
||||
: timeoutConfiguration.slowOperation,
|
||||
progressId: 'hot.restart',
|
||||
);
|
||||
|
||||
@ -731,7 +728,6 @@ class _ResidentWebRunner extends ResidentWebRunner {
|
||||
);
|
||||
final Status devFSStatus = globals.logger.startProgress(
|
||||
'Syncing files to device ${device.device.name}...',
|
||||
timeout: timeoutConfiguration.fastOperation,
|
||||
);
|
||||
final UpdateFSReport report = await device.devFS.update(
|
||||
mainUri: await _generateEntrypoint(
|
||||
|
@ -46,7 +46,6 @@ Future<void> buildLinux(
|
||||
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Building Linux application...',
|
||||
timeout: null,
|
||||
);
|
||||
try {
|
||||
final String buildModeName = getNameForBuildMode(buildInfo.mode ?? BuildMode.release);
|
||||
|
@ -79,7 +79,6 @@ Future<void> buildMacOS({
|
||||
final Stopwatch sw = Stopwatch()..start();
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Building macOS application...',
|
||||
timeout: null,
|
||||
);
|
||||
int result;
|
||||
try {
|
||||
|
@ -83,15 +83,13 @@ class CocoaPods {
|
||||
@required XcodeProjectInterpreter xcodeProjectInterpreter,
|
||||
@required Logger logger,
|
||||
@required Platform platform,
|
||||
@required TimeoutConfiguration timeoutConfiguration,
|
||||
}) : _fileSystem = fileSystem,
|
||||
_processManager = processManager,
|
||||
_xcodeProjectInterpreter = xcodeProjectInterpreter,
|
||||
_logger = logger,
|
||||
_platform = platform,
|
||||
_processUtils = ProcessUtils(processManager: processManager, logger: logger),
|
||||
_fileSystemUtils = FileSystemUtils(fileSystem: fileSystem, platform: platform),
|
||||
_timeoutConfiguration = timeoutConfiguration;
|
||||
_fileSystemUtils = FileSystemUtils(fileSystem: fileSystem, platform: platform);
|
||||
|
||||
final FileSystem _fileSystem;
|
||||
final ProcessManager _processManager;
|
||||
@ -100,7 +98,6 @@ class CocoaPods {
|
||||
final XcodeProjectInterpreter _xcodeProjectInterpreter;
|
||||
final Logger _logger;
|
||||
final Platform _platform;
|
||||
final TimeoutConfiguration _timeoutConfiguration;
|
||||
|
||||
Future<String> _versionText;
|
||||
|
||||
@ -342,7 +339,7 @@ class CocoaPods {
|
||||
}
|
||||
|
||||
Future<void> _runPodInstall(XcodeBasedProject xcodeProject, String engineDirectory) async {
|
||||
final Status status = _logger.startProgress('Running pod install...', timeout: _timeoutConfiguration.slowOperation);
|
||||
final Status status = _logger.startProgress('Running pod install...');
|
||||
final ProcessResult result = await _processManager.run(
|
||||
<String>['pod', 'install', '--verbose'],
|
||||
workingDirectory: _fileSystem.path.dirname(xcodeProject.podfile.path),
|
||||
|
@ -670,7 +670,6 @@ class FlutterDevice {
|
||||
}) async {
|
||||
final Status devFSStatus = globals.logger.startProgress(
|
||||
'Syncing files to device ${device.name}...',
|
||||
timeout: timeoutConfiguration.fastOperation,
|
||||
);
|
||||
UpdateFSReport report;
|
||||
try {
|
||||
@ -1089,7 +1088,6 @@ abstract class ResidentRunner {
|
||||
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Taking screenshot for ${device.device.name}...',
|
||||
timeout: timeoutConfiguration.fastOperation,
|
||||
);
|
||||
final File outputFile = globals.fsUtils.getUniqueFile(
|
||||
globals.fs.currentDirectory,
|
||||
@ -1237,7 +1235,6 @@ abstract class ResidentRunner {
|
||||
// This will wait for at least one flutter view before returning.
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Waiting for ${device.device.name} to report its views...',
|
||||
timeout: const Duration(milliseconds: 200),
|
||||
);
|
||||
try {
|
||||
await device.vmService.getFlutterViews();
|
||||
|
@ -659,7 +659,6 @@ class HotRunner extends ResidentRunner {
|
||||
if (!silent) {
|
||||
status = globals.logger.startProgress(
|
||||
'Performing hot restart...',
|
||||
timeout: timeoutConfiguration.fastOperation,
|
||||
progressId: 'hot.restart',
|
||||
);
|
||||
}
|
||||
@ -709,7 +708,6 @@ class HotRunner extends ResidentRunner {
|
||||
}) async {
|
||||
Status status = globals.logger.startProgress(
|
||||
'Performing hot reload...',
|
||||
timeout: timeoutConfiguration.fastOperation,
|
||||
progressId: 'hot.reload',
|
||||
);
|
||||
OperationResult result;
|
||||
@ -724,7 +722,6 @@ class HotRunner extends ResidentRunner {
|
||||
status?.cancel();
|
||||
status = globals.logger.startProgress(
|
||||
message,
|
||||
timeout: timeoutConfiguration.slowOperation,
|
||||
progressId: 'hot.reload',
|
||||
);
|
||||
},
|
||||
|
@ -43,7 +43,6 @@ class Tracing {
|
||||
if (awaitFirstFrame) {
|
||||
final Status status = _logger.startProgress(
|
||||
'Waiting for application to render first frame...',
|
||||
timeout: null,
|
||||
);
|
||||
try {
|
||||
final Completer<void> whenFirstFrameRendered = Completer<void>();
|
||||
|
@ -42,7 +42,7 @@ Future<void> buildWeb(
|
||||
outputDirectory.createSync(recursive: true);
|
||||
}
|
||||
await injectPlugins(flutterProject, checkProjects: true);
|
||||
final Status status = globals.logger.startProgress('Compiling $target for the Web...', timeout: null);
|
||||
final Status status = globals.logger.startProgress('Compiling $target for the Web...');
|
||||
final Stopwatch sw = Stopwatch()..start();
|
||||
try {
|
||||
final BuildResult result = await globals.buildSystem.build(const WebServiceWorker(), Environment(
|
||||
|
@ -56,7 +56,6 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {
|
||||
final Directory buildDirectory = globals.fs.directory(getWindowsBuildDirectory());
|
||||
final Status status = globals.logger.startProgress(
|
||||
'Building Windows application...',
|
||||
timeout: null,
|
||||
);
|
||||
try {
|
||||
await _runCmakeGeneration(cmakePath, buildDirectory, windowsProject.cmakeFile.parent);
|
||||
|
@ -674,8 +674,6 @@ class StreamLogger extends Logger {
|
||||
}) {
|
||||
_log('[progress] $message');
|
||||
return SilentStatus(
|
||||
timeout: timeout,
|
||||
timeoutConfiguration: timeoutConfiguration,
|
||||
stopwatch: Stopwatch(),
|
||||
)..start();
|
||||
}
|
||||
|
@ -474,7 +474,6 @@ AndroidDevice setUpAndroidDevice({
|
||||
fileSystem: fileSystem ?? MemoryFileSystem.test(),
|
||||
processManager: processManager ?? FakeProcessManager.any(),
|
||||
androidConsoleSocketFactory: androidConsoleSocketFactory,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,6 @@ void main() {
|
||||
terminal: Terminal.test(supportsColor: true),
|
||||
stdio: MockStdio(),
|
||||
outputPreferences: OutputPreferences.test(),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
final ArtifactUpdater artifactUpdater = ArtifactUpdater(
|
||||
fileSystem: fileSystem,
|
||||
|
@ -3,7 +3,6 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert' show jsonEncode;
|
||||
|
||||
import 'package:flutter_tools/executable.dart';
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
@ -33,7 +32,6 @@ void main() {
|
||||
terminal: Terminal.test(),
|
||||
stdio: mocks.MockStdio(),
|
||||
outputPreferences: OutputPreferences.test(),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
|
||||
expect(loggerFactory.createLogger(
|
||||
@ -155,19 +153,16 @@ void main() {
|
||||
_throwsInvocationFor(() => fakeLogger.sendEvent(message, eventArgs)),
|
||||
);
|
||||
|
||||
const Duration timeout = Duration(seconds: 12);
|
||||
const String progressId = 'progressId';
|
||||
const bool multilineOutput = true;
|
||||
const int progressIndicatorPadding = kDefaultStatusPadding * 2;
|
||||
expect(
|
||||
() => delegatingLogger.startProgress(message,
|
||||
timeout: timeout,
|
||||
progressId: progressId,
|
||||
multilineOutput: multilineOutput,
|
||||
progressIndicatorPadding: progressIndicatorPadding,
|
||||
),
|
||||
_throwsInvocationFor(() => fakeLogger.startProgress(message,
|
||||
timeout: timeout,
|
||||
progressId: progressId,
|
||||
multilineOutput: multilineOutput,
|
||||
progressIndicatorPadding: progressIndicatorPadding,
|
||||
@ -279,7 +274,6 @@ void main() {
|
||||
),
|
||||
stdio: stdio,
|
||||
outputPreferences: OutputPreferences.test(),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus('message');
|
||||
logger.printError('error message');
|
||||
@ -320,7 +314,6 @@ void main() {
|
||||
),
|
||||
stdio: stdio,
|
||||
outputPreferences: OutputPreferences.test(),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus('message');
|
||||
logger.printError('error message');
|
||||
@ -359,7 +352,6 @@ void main() {
|
||||
),
|
||||
stdio: stdio,
|
||||
outputPreferences: OutputPreferences.test(),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus('message');
|
||||
logger.printError('error message');
|
||||
@ -441,11 +433,9 @@ void main() {
|
||||
|
||||
ansiStatus = AnsiStatus(
|
||||
message: 'Hello world',
|
||||
timeout: const Duration(seconds: 2),
|
||||
padding: 20,
|
||||
onFinish: () => called += 1,
|
||||
stdio: mockStdio,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
stopwatch: stopwatchFactory.createStopwatch(),
|
||||
terminal: terminal,
|
||||
);
|
||||
@ -456,9 +446,7 @@ void main() {
|
||||
mockStopwatch = FakeStopwatch();
|
||||
FakeAsync().run((FakeAsync time) {
|
||||
final AnsiSpinner ansiSpinner = AnsiSpinner(
|
||||
timeout: const Duration(hours: 10),
|
||||
stdio: mockStdio,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
stopwatch: stopwatchFactory.createStopwatch(),
|
||||
terminal: terminal,
|
||||
)..start();
|
||||
@ -487,72 +475,37 @@ void main() {
|
||||
expect(done, isTrue);
|
||||
});
|
||||
|
||||
testWithoutContext('AnsiSpinner works (2)', () async {
|
||||
bool done = false;
|
||||
mockStopwatch = FakeStopwatch();
|
||||
FakeAsync().run((FakeAsync time) {
|
||||
final AnsiSpinner ansiSpinner = AnsiSpinner(
|
||||
timeout: const Duration(seconds: 2),
|
||||
stdio: mockStdio,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
stopwatch: mockStopwatch,
|
||||
terminal: terminal,
|
||||
)..start();
|
||||
mockStopwatch.elapsed = const Duration(seconds: 1);
|
||||
doWhileAsync(time, () => ansiSpinner.ticks < 10); // one second
|
||||
|
||||
expect(ansiSpinner.seemsSlow, isFalse);
|
||||
expect(outputStdout().join('\n'), isNot(contains('This is taking an unexpectedly long time.')));
|
||||
mockStopwatch.elapsed = const Duration(seconds: 3);
|
||||
doWhileAsync(time, () => ansiSpinner.ticks < 30); // three seconds
|
||||
|
||||
expect(ansiSpinner.seemsSlow, isTrue);
|
||||
// Check the 2nd line to verify there's a newline before the warning
|
||||
expect(outputStdout()[1], contains('This is taking an unexpectedly long time.'));
|
||||
ansiSpinner.stop();
|
||||
expect(outputStdout().join('\n'), isNot(contains('(!)')));
|
||||
done = true;
|
||||
});
|
||||
expect(done, isTrue);
|
||||
});
|
||||
|
||||
testWithoutContext('Stdout startProgress on colored terminal', () async {
|
||||
bool done = false;
|
||||
FakeAsync().run((FakeAsync time) {
|
||||
final Logger logger = StdoutLogger(
|
||||
terminal: coloredTerminal,
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: true),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
stopwatchFactory: stopwatchFactory,
|
||||
);
|
||||
final Status status = logger.startProgress(
|
||||
'Hello',
|
||||
progressId: null,
|
||||
timeout: const TimeoutConfiguration().slowOperation,
|
||||
progressIndicatorPadding: 20, // this minus the "Hello" equals the 15 below.
|
||||
);
|
||||
expect(outputStderr().length, equals(1));
|
||||
expect(outputStderr().first, isEmpty);
|
||||
// the 5 below is the margin that is always included between the message and the time.
|
||||
expect(
|
||||
outputStdout().join('\n'),
|
||||
matches(terminal.supportsEmoji
|
||||
? r'^Hello {15} {5} {8}[\b]{8} {7}⣽$'
|
||||
: r'^Hello {15} {5} {8}[\b]{8} {7}\\$'),
|
||||
);
|
||||
status.stop();
|
||||
expect(
|
||||
outputStdout().join('\n'),
|
||||
matches(
|
||||
terminal.supportsEmoji
|
||||
? r'^Hello {15} {5} {8}[\b]{8} {7}⣽[\b]{8} {8}[\b]{8}[\d, ]{4}[\d]\.[\d]s[\n]$'
|
||||
: r'^Hello {15} {5} {8}[\b]{8} {7}\\[\b]{8} {8}[\b]{8}[\d, ]{4}[\d]\.[\d]s[\n]$',
|
||||
),
|
||||
);
|
||||
done = true;
|
||||
});
|
||||
expect(done, isTrue);
|
||||
final Logger logger = StdoutLogger(
|
||||
terminal: coloredTerminal,
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: true),
|
||||
stopwatchFactory: stopwatchFactory,
|
||||
);
|
||||
final Status status = logger.startProgress(
|
||||
'Hello',
|
||||
progressId: null,
|
||||
progressIndicatorPadding: 20, // this minus the "Hello" equals the 15 below.
|
||||
);
|
||||
expect(outputStderr().length, equals(1));
|
||||
expect(outputStderr().first, isEmpty);
|
||||
// the 5 below is the margin that is always included between the message and the time.
|
||||
expect(
|
||||
outputStdout().join('\n'),
|
||||
matches(terminal.supportsEmoji
|
||||
? r'^Hello {15} {5} {8}[\b]{8} {7}⣽$'
|
||||
: r'^Hello {15} {5} {8}[\b]{8} {7}\\$'),
|
||||
);
|
||||
mockStopwatch.elapsed = const Duration(seconds: 4, milliseconds: 100);
|
||||
status.stop();
|
||||
expect(
|
||||
outputStdout().join('\n'),
|
||||
matches(
|
||||
terminal.supportsEmoji
|
||||
? r'^Hello {15} {5} {8}[\b]{8} {7}⣽[\b]{8} {8}[\b]{8}[\d, ]{4}[\d]\.[\d]s[\n]$'
|
||||
: r'^Hello {15} {5} {8}[\b]{8} {7}\\[\b]{8} {8}[\b]{8}[\d, ]{4}[\d]\.[\d]s[\n]$',
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
testWithoutContext('Stdout startProgress on colored terminal pauses', () async {
|
||||
@ -563,12 +516,10 @@ void main() {
|
||||
terminal: coloredTerminal,
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: true),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
stopwatchFactory: stopwatchFactory,
|
||||
);
|
||||
final Status status = logger.startProgress(
|
||||
"Knock Knock, Who's There",
|
||||
timeout: const Duration(days: 10),
|
||||
progressIndicatorPadding: 10,
|
||||
);
|
||||
logger.printStatus('Rude Interrupting Cow');
|
||||
@ -598,38 +549,6 @@ void main() {
|
||||
expect(done, isTrue);
|
||||
});
|
||||
|
||||
testWithoutContext('AnsiStatus works', () {
|
||||
bool done = false;
|
||||
FakeAsync().run((FakeAsync time) {
|
||||
ansiStatus.start();
|
||||
mockStopwatch.elapsed = const Duration(seconds: 1);
|
||||
doWhileAsync(time, () => ansiStatus.ticks < 10); // one second
|
||||
|
||||
expect(ansiStatus.seemsSlow, isFalse);
|
||||
expect(outputStdout().join('\n'), isNot(contains('This is taking an unexpectedly long time.')));
|
||||
expect(outputStdout().join('\n'), isNot(contains('(!)')));
|
||||
mockStopwatch.elapsed = const Duration(seconds: 3);
|
||||
doWhileAsync(time, () => ansiStatus.ticks < 30); // three seconds
|
||||
|
||||
expect(ansiStatus.seemsSlow, isTrue);
|
||||
expect(outputStdout().join('\n'), contains('This is taking an unexpectedly long time.'));
|
||||
|
||||
// Test that the number of '\b' is correct.
|
||||
for (final String line in outputStdout()) {
|
||||
int currLength = 0;
|
||||
for (int i = 0; i < line.length; i += 1) {
|
||||
currLength += line[i] == '\b' ? -1 : 1;
|
||||
expect(currLength, isNonNegative, reason: 'The following line has overflow backtraces:\n' + jsonEncode(line));
|
||||
}
|
||||
}
|
||||
|
||||
ansiStatus.stop();
|
||||
expect(outputStdout().join('\n'), contains('(!)'));
|
||||
done = true;
|
||||
});
|
||||
expect(done, isTrue);
|
||||
});
|
||||
|
||||
testWithoutContext('AnsiStatus works when canceled', () async {
|
||||
bool done = false;
|
||||
FakeAsync().run((FakeAsync time) {
|
||||
@ -717,18 +636,15 @@ void main() {
|
||||
mocks.MockStdio mockStdio;
|
||||
SummaryStatus summaryStatus;
|
||||
int called;
|
||||
final RegExp secondDigits = RegExp(r'[^\b]\b\b\b\b\b[0-9]+[.][0-9]+(?:s|ms)');
|
||||
|
||||
setUp(() {
|
||||
mockStdio = mocks.MockStdio();
|
||||
called = 0;
|
||||
summaryStatus = SummaryStatus(
|
||||
message: 'Hello world',
|
||||
timeout: const TimeoutConfiguration().slowOperation,
|
||||
padding: 20,
|
||||
onFinish: () => called++,
|
||||
stdio: mockStdio,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
stopwatch: FakeStopwatch(),
|
||||
);
|
||||
});
|
||||
@ -744,7 +660,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printError('0123456789' * 15);
|
||||
final List<String> lines = outputStderr();
|
||||
@ -774,7 +689,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printError('0123456789' * 15, indent: 5);
|
||||
final List<String> lines = outputStderr();
|
||||
@ -798,7 +712,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printError('0123456789' * 15, hangingIndent: 5);
|
||||
final List<String> lines = outputStderr();
|
||||
@ -822,7 +735,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printError('0123456789' * 15, indent: 4, hangingIndent: 5);
|
||||
final List<String> lines = outputStderr();
|
||||
@ -846,7 +758,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus('0123456789' * 15);
|
||||
final List<String> lines = outputStdout();
|
||||
@ -867,7 +778,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus('0123456789' * 15, indent: 5);
|
||||
final List<String> lines = outputStdout();
|
||||
@ -890,8 +800,7 @@ void main() {
|
||||
platform: _kNoAnsiPlatform,
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false)
|
||||
);
|
||||
logger.printStatus('0123456789' * 15, hangingIndent: 5);
|
||||
final List<String> lines = outputStdout();
|
||||
@ -915,7 +824,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus('0123456789' * 15, indent: 4, hangingIndent: 5);
|
||||
final List<String> lines = outputStdout();
|
||||
@ -939,7 +847,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: true),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printError('Pants on fire!');
|
||||
final List<String> lines = outputStderr();
|
||||
@ -957,7 +864,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: true),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus('All good.');
|
||||
|
||||
@ -975,7 +881,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: true),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus(
|
||||
null,
|
||||
@ -999,7 +904,6 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.printStatus(
|
||||
null,
|
||||
@ -1015,59 +919,52 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('Stdout startProgress on non-color terminal', () async {
|
||||
bool done = false;
|
||||
FakeAsync().run((FakeAsync time) {
|
||||
final Logger logger = StdoutLogger(
|
||||
terminal: AnsiTerminal(
|
||||
stdio: mockStdio,
|
||||
platform: _kNoAnsiPlatform,
|
||||
),
|
||||
final FakeStopwatch fakeStopwatch = FakeStopwatch();
|
||||
final Logger logger = StdoutLogger(
|
||||
terminal: AnsiTerminal(
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
final Status status = logger.startProgress(
|
||||
'Hello',
|
||||
progressId: null,
|
||||
timeout: const TimeoutConfiguration().slowOperation,
|
||||
progressIndicatorPadding: 20, // this minus the "Hello" equals the 15 below.
|
||||
);
|
||||
expect(outputStderr().length, equals(1));
|
||||
expect(outputStderr().first, isEmpty);
|
||||
// the 5 below is the margin that is always included between the message and the time.
|
||||
expect(outputStdout().join('\n'), matches(r'^Hello {15} {5}$'));
|
||||
status.stop();
|
||||
expect(outputStdout().join('\n'), matches(r'^Hello {15} {5}[\d, ]{4}[\d]\.[\d]s[\n]$'));
|
||||
done = true;
|
||||
});
|
||||
expect(done, isTrue);
|
||||
platform: _kNoAnsiPlatform,
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: false),
|
||||
stopwatchFactory: FakeStopwatchFactory(fakeStopwatch),
|
||||
);
|
||||
final Status status = logger.startProgress(
|
||||
'Hello',
|
||||
progressId: null,
|
||||
progressIndicatorPadding: 20, // this minus the "Hello" equals the 15 below.
|
||||
);
|
||||
expect(outputStderr().length, equals(1));
|
||||
expect(outputStderr().first, isEmpty);
|
||||
// the 5 below is the margin that is always included between the message and the time.
|
||||
expect(outputStdout().join('\n'), matches(r'^Hello {15} {5}$'));
|
||||
|
||||
fakeStopwatch.elapsed = const Duration(seconds: 4, milliseconds: 123);
|
||||
status.stop();
|
||||
|
||||
expect(outputStdout(), <String>['Hello 4.1s', '']);
|
||||
});
|
||||
|
||||
testWithoutContext('SummaryStatus works when canceled', () async {
|
||||
final SummaryStatus summaryStatus = SummaryStatus(
|
||||
message: 'Hello world',
|
||||
timeout: const TimeoutConfiguration().slowOperation,
|
||||
padding: 20,
|
||||
onFinish: () => called++,
|
||||
stdio: mockStdio,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
stopwatch: FakeStopwatch(),
|
||||
);
|
||||
summaryStatus.start();
|
||||
List<String> lines = outputStdout();
|
||||
final List<String> lines = outputStdout();
|
||||
expect(lines[0], startsWith('Hello world '));
|
||||
expect(lines.length, equals(1));
|
||||
expect(lines[0].endsWith('\n'), isFalse);
|
||||
|
||||
// Verify a cancel does _not_ print the time and prints a newline.
|
||||
summaryStatus.cancel();
|
||||
lines = outputStdout();
|
||||
final List<Match> matches = secondDigits.allMatches(lines[0]).toList();
|
||||
expect(matches, isEmpty);
|
||||
expect(lines[0], endsWith(' '));
|
||||
expect(called, equals(1));
|
||||
expect(lines.length, equals(2));
|
||||
expect(lines[1], equals(''));
|
||||
expect(outputStdout(), <String>[
|
||||
'Hello world ',
|
||||
'',
|
||||
]);
|
||||
|
||||
// Verify that stopping or canceling multiple times throws.
|
||||
expect(summaryStatus.cancel, throwsAssertionError);
|
||||
@ -1076,21 +973,16 @@ void main() {
|
||||
|
||||
testWithoutContext('SummaryStatus works when stopped', () async {
|
||||
summaryStatus.start();
|
||||
List<String> lines = outputStdout();
|
||||
final List<String> lines = outputStdout();
|
||||
expect(lines[0], startsWith('Hello world '));
|
||||
expect(lines.length, equals(1));
|
||||
|
||||
// Verify a stop prints the time.
|
||||
summaryStatus.stop();
|
||||
lines = outputStdout();
|
||||
final List<Match> matches = secondDigits.allMatches(lines[0]).toList();
|
||||
expect(matches, isNotNull);
|
||||
expect(matches, hasLength(1));
|
||||
final Match match = matches.first;
|
||||
expect(lines[0], endsWith(match.group(0)));
|
||||
expect(called, equals(1));
|
||||
expect(lines.length, equals(2));
|
||||
expect(lines[1], equals(''));
|
||||
expect(outputStdout(), <String>[
|
||||
'Hello world 0ms',
|
||||
'',
|
||||
]);
|
||||
|
||||
// Verify that stopping or canceling multiple times throws.
|
||||
expect(summaryStatus.stop, throwsAssertionError);
|
||||
@ -1105,10 +997,9 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(showColor: false),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
logger.startProgress('AAA', timeout: const TimeoutConfiguration().fastOperation).stop();
|
||||
logger.startProgress('BBB', timeout: const TimeoutConfiguration().fastOperation).stop();
|
||||
logger.startProgress('AAA').stop();
|
||||
logger.startProgress('BBB').stop();
|
||||
final List<String> output = outputStdout();
|
||||
|
||||
expect(output.length, equals(3));
|
||||
@ -1129,12 +1020,11 @@ void main() {
|
||||
),
|
||||
stdio: mockStdio,
|
||||
outputPreferences: OutputPreferences.test(),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
),
|
||||
stopwatchFactory: FakeStopwatchFactory(),
|
||||
);
|
||||
logger.startProgress('AAA', timeout: const TimeoutConfiguration().fastOperation).stop();
|
||||
logger.startProgress('BBB', timeout: const TimeoutConfiguration().fastOperation).stop();
|
||||
logger.startProgress('AAA').stop();
|
||||
logger.startProgress('BBB').stop();
|
||||
|
||||
expect(outputStdout(), <Matcher>[
|
||||
matches(r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] AAA$'),
|
||||
@ -1153,8 +1043,8 @@ void main() {
|
||||
),
|
||||
outputPreferences: OutputPreferences.test(),
|
||||
);
|
||||
logger.startProgress('AAA', timeout: const TimeoutConfiguration().fastOperation).stop();
|
||||
logger.startProgress('BBB', timeout: const TimeoutConfiguration().fastOperation).stop();
|
||||
logger.startProgress('AAA').stop();
|
||||
logger.startProgress('BBB').stop();
|
||||
|
||||
expect(logger.statusText, 'AAA\nBBB\n');
|
||||
});
|
||||
|
@ -71,7 +71,6 @@ void main() {
|
||||
logger: logger,
|
||||
platform: FakePlatform(),
|
||||
xcodeProjectInterpreter: mockXcodeProjectInterpreter,
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
);
|
||||
pretendPodVersionIs('1.8.0');
|
||||
fileSystem.file(fileSystem.path.join(
|
||||
|
@ -22,7 +22,6 @@ final ProcessUtils processUtils = ProcessUtils(processManager: processManager, l
|
||||
),
|
||||
stdio: stdio,
|
||||
outputPreferences: OutputPreferences.test(wrapText: true),
|
||||
timeoutConfiguration: const TimeoutConfiguration(),
|
||||
));
|
||||
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
|
||||
|
||||
|
@ -127,7 +127,6 @@ void testUsingContext(
|
||||
Usage: () => FakeUsage(),
|
||||
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreter(),
|
||||
FileSystem: () => LocalFileSystemBlockingSetCurrentDirectory(),
|
||||
TimeoutConfiguration: () => const TimeoutConfiguration(),
|
||||
PlistParser: () => FakePlistParser(),
|
||||
Signals: () => FakeSignals(),
|
||||
Pub: () => ThrowingPub(), // prevent accidentally using pub.
|
||||
|
Loading…
x
Reference in New Issue
Block a user