mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
Make timeout more robust (#12969)
This commit is contained in:
parent
a836201a74
commit
e3d5cbc929
|
@ -22,6 +22,9 @@ import '../src/context.dart';
|
|||
const String frameworkRevision = '12345678';
|
||||
const String frameworkChannel = 'omega';
|
||||
|
||||
const Timeout createProjectTimeout = const Timeout.factor(2.0);
|
||||
const Timeout createProjectAndGetPackagesTimeout = const Timeout.factor(10.0);
|
||||
|
||||
void main() {
|
||||
group('create', () {
|
||||
Directory temp;
|
||||
|
@ -57,7 +60,7 @@ void main() {
|
|||
'flutter_project.iml',
|
||||
],
|
||||
);
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: createProjectAndGetPackagesTimeout);
|
||||
|
||||
testUsingContext('kotlin/swift project', () async {
|
||||
return _createProject(
|
||||
|
@ -76,7 +79,7 @@ void main() {
|
|||
'ios/Runner/main.m',
|
||||
],
|
||||
);
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: createProjectTimeout);
|
||||
|
||||
testUsingContext('package project', () async {
|
||||
return _createAndAnalyzeProject(
|
||||
|
@ -103,7 +106,7 @@ void main() {
|
|||
'test/widget_test.dart',
|
||||
],
|
||||
);
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: createProjectAndGetPackagesTimeout);
|
||||
|
||||
testUsingContext('plugin project', () async {
|
||||
return _createAndAnalyzeProject(
|
||||
|
@ -123,7 +126,7 @@ void main() {
|
|||
],
|
||||
plugin: true,
|
||||
);
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: createProjectAndGetPackagesTimeout);
|
||||
|
||||
testUsingContext('kotlin/swift plugin project', () async {
|
||||
return _createProject(
|
||||
|
@ -149,7 +152,7 @@ void main() {
|
|||
],
|
||||
plugin: true,
|
||||
);
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: createProjectTimeout);
|
||||
|
||||
testUsingContext('plugin project with custom org', () async {
|
||||
return _createProject(
|
||||
|
@ -165,7 +168,7 @@ void main() {
|
|||
],
|
||||
plugin: true,
|
||||
);
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: createProjectTimeout);
|
||||
|
||||
testUsingContext('project with-driver-test', () async {
|
||||
return _createAndAnalyzeProject(
|
||||
|
@ -173,7 +176,7 @@ void main() {
|
|||
<String>['--with-driver-test'],
|
||||
<String>['lib/main.dart'],
|
||||
);
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: createProjectAndGetPackagesTimeout);
|
||||
|
||||
// Verify content and formatting
|
||||
testUsingContext('content', () async {
|
||||
|
@ -249,7 +252,7 @@ void main() {
|
|||
overrides: <Type, Generator>{
|
||||
FlutterVersion: () => mockFlutterVersion,
|
||||
},
|
||||
timeout: const Timeout.factor(3.0));
|
||||
timeout: createProjectTimeout);
|
||||
|
||||
// Verify that we can regenerate over an existing project.
|
||||
testUsingContext('can re-gen over existing project', () async {
|
||||
|
@ -261,7 +264,7 @@ void main() {
|
|||
await runner.run(<String>['create', '--no-pub', projectDir.path]);
|
||||
|
||||
await runner.run(<String>['create', '--no-pub', projectDir.path]);
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: createProjectTimeout);
|
||||
|
||||
// Verify that we help the user correct an option ordering issue
|
||||
testUsingContext('produces sensible error message', () async {
|
||||
|
|
|
@ -17,6 +17,8 @@ import 'package:test/test.dart';
|
|||
import '../src/common.dart';
|
||||
import '../src/context.dart';
|
||||
|
||||
const Timeout remotePubTimeout = const Timeout.factor(10.0);
|
||||
|
||||
void main() {
|
||||
Cache.disableLocking();
|
||||
group('packages get/upgrade', () {
|
||||
|
@ -55,7 +57,7 @@ void main() {
|
|||
final String projectPath = await runCommand('get');
|
||||
expectExists(projectPath, 'lib/main.dart');
|
||||
expectExists(projectPath, '.packages');
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: remotePubTimeout);
|
||||
|
||||
testUsingContext('get --offline', () async {
|
||||
final String projectPath = await runCommand('get', args: <String>['--offline']);
|
||||
|
@ -67,7 +69,7 @@ void main() {
|
|||
final String projectPath = await runCommand('upgrade');
|
||||
expectExists(projectPath, 'lib/main.dart');
|
||||
expectExists(projectPath, '.packages');
|
||||
}, timeout: const Timeout.factor(3.0));
|
||||
}, timeout: remotePubTimeout);
|
||||
});
|
||||
|
||||
group('packages test/pub', () {
|
||||
|
|
Loading…
Reference in a new issue