enable lint unnecessary_const (#19342)
This commit is contained in:
committed by
GitHub
parent
d10e46ea65
commit
cc1cf13eec
@@ -16,7 +16,7 @@ import 'utils.dart';
|
||||
/// Maximum amount of time a single task is allowed to take to run.
|
||||
///
|
||||
/// If exceeded the task is considered to have failed.
|
||||
const Duration _kDefaultTaskTimeout = const Duration(minutes: 15);
|
||||
const Duration _kDefaultTaskTimeout = Duration(minutes: 15);
|
||||
|
||||
/// Represents a unit of work performed in the CI environment that can
|
||||
/// succeed, fail and be retried independently of others.
|
||||
@@ -103,7 +103,7 @@ class _TaskRunner {
|
||||
_keepAlivePort = new RawReceivePort();
|
||||
|
||||
// Timeout if nothing bothers to connect and ask us to run the task.
|
||||
const Duration taskStartTimeout = const Duration(seconds: 10);
|
||||
const Duration taskStartTimeout = Duration(seconds: 10);
|
||||
_startTaskTimeout = new Timer(taskStartTimeout, () {
|
||||
if (!_taskStarted) {
|
||||
logger.severe('Task did not start in $taskStartTimeout.');
|
||||
@@ -147,7 +147,7 @@ class TaskResult {
|
||||
TaskResult.success(this.data, {this.benchmarkScoreKeys = const <String>[]})
|
||||
: this.succeeded = true,
|
||||
this.message = 'success' {
|
||||
const JsonEncoder prettyJson = const JsonEncoder.withIndent(' ');
|
||||
const JsonEncoder prettyJson = JsonEncoder.withIndent(' ');
|
||||
if (benchmarkScoreKeys != null) {
|
||||
for (String key in benchmarkScoreKeys) {
|
||||
if (!data.containsKey(key)) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'utils.dart';
|
||||
|
||||
const String _kProvisioningConfigFileEnvironmentVariable = 'FLUTTER_DEVICELAB_XCODE_PROVISIONING_CONFIG';
|
||||
const String _kTestXcconfigFileName = 'TestConfig.xcconfig';
|
||||
const FileSystem _fs = const io.LocalFileSystem();
|
||||
const FileSystem _fs = io.LocalFileSystem();
|
||||
|
||||
/// Patches the given Xcode project adding provisioning certificates and team
|
||||
/// information required to build and run the project, if
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:flutter_devicelab/framework/utils.dart';
|
||||
|
||||
/// Slightly longer than task timeout that gives the task runner a chance to
|
||||
/// clean-up before forcefully quitting it.
|
||||
const Duration taskTimeoutWithGracePeriod = const Duration(minutes: 26);
|
||||
const Duration taskTimeoutWithGracePeriod = Duration(minutes: 26);
|
||||
|
||||
/// Runs a task in a separate Dart VM and collects the result using the VM
|
||||
/// service protocol.
|
||||
@@ -111,7 +111,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
|
||||
throw 'not ready yet';
|
||||
return isolate;
|
||||
} catch (error) {
|
||||
const Duration connectionTimeout = const Duration(seconds: 10);
|
||||
const Duration connectionTimeout = Duration(seconds: 10);
|
||||
if (new DateTime.now().difference(started) > connectionTimeout) {
|
||||
throw new TimeoutException(
|
||||
'Failed to connect to the task runner process',
|
||||
@@ -119,7 +119,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
|
||||
);
|
||||
}
|
||||
print('VM service not ready yet: $error');
|
||||
const Duration pauseBetweenRetries = const Duration(milliseconds: 200);
|
||||
const Duration pauseBetweenRetries = Duration(milliseconds: 200);
|
||||
print('Will retry in $pauseBetweenRetries.');
|
||||
await new Future<Null>.delayed(pauseBetweenRetries);
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ void setLocalEngineOptionIfNecessary(List<String> options, [String flavor]) {
|
||||
// If engine flavor was not specified explicitly then scan options looking
|
||||
// for flags that specify the engine flavor (--release, --profile or
|
||||
// --debug). Default flavor to debug if no flags were found.
|
||||
const Map<String, String> optionToFlavor = const <String, String>{
|
||||
const Map<String, String> optionToFlavor = <String, String>{
|
||||
'--release': 'release',
|
||||
'--debug': 'debug',
|
||||
'--profile': 'profile',
|
||||
@@ -557,7 +557,7 @@ void setLocalEngineOptionIfNecessary(List<String> options, [String flavor]) {
|
||||
flavor ??= 'debug';
|
||||
}
|
||||
|
||||
const Map<DeviceOperatingSystem, String> osNames = const <DeviceOperatingSystem, String>{
|
||||
const Map<DeviceOperatingSystem, String> osNames = <DeviceOperatingSystem, String>{
|
||||
DeviceOperatingSystem.ios: 'ios',
|
||||
DeviceOperatingSystem.android: 'android',
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ Future<TaskResult> runEndToEndTests() async {
|
||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
|
||||
await prepareProvisioningCertificates(testDirectory.path);
|
||||
|
||||
const List<String> entryPoints = const <String>[
|
||||
const List<String> entryPoints = <String>[
|
||||
'lib/keyboard_resize.dart',
|
||||
'lib/driver.dart',
|
||||
'lib/screenshot.dart',
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'package:flutter_devicelab/framework/ios.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
|
||||
/// The maximum amount of time a single microbenchmark is allowed to take.
|
||||
const Duration _kBenchmarkTimeout = const Duration(minutes: 10);
|
||||
const Duration _kBenchmarkTimeout = Duration(minutes: 10);
|
||||
|
||||
/// Creates a device lab task that runs benchmarks in
|
||||
/// `dev/benchmarks/microbenchmarks` reports results to the dashboard.
|
||||
|
||||
@@ -113,7 +113,7 @@ TaskFunction createBasicMaterialCompileTest() {
|
||||
|
||||
/// Measure application startup performance.
|
||||
class StartupTest {
|
||||
static const Duration _startupTimeout = const Duration(minutes: 5);
|
||||
static const Duration _startupTimeout = Duration(minutes: 5);
|
||||
|
||||
const StartupTest(this.testDirectory, { this.reportMetrics = true });
|
||||
|
||||
@@ -350,7 +350,7 @@ class CompileTest {
|
||||
};
|
||||
}
|
||||
|
||||
static const Map<String, String> _kSdkNameToMetricNameMapping = const <String, String> {
|
||||
static const Map<String, String> _kSdkNameToMetricNameMapping = <String, String> {
|
||||
'VMIsolate': 'aot_snapshot_size_vmisolate',
|
||||
'Isolate': 'aot_snapshot_size_isolate',
|
||||
'ReadOnlyData': 'aot_snapshot_size_rodata',
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:process/process.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
const ProcessManager processManager = const LocalProcessManager();
|
||||
const ProcessManager processManager = LocalProcessManager();
|
||||
|
||||
group('run.dart script', () {
|
||||
Future<ProcessResult> runScript(List<String> testNames) async {
|
||||
|
||||
Reference in New Issue
Block a user