Re-add tool test general per-test timeout (#74531)

This commit is contained in:
Jenn Magder 2021-01-25 12:47:01 -08:00 committed by GitHub
parent 92427f260a
commit 35000147e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -301,6 +301,8 @@ Future<void> _runToolTests() async {
forceSingleCore: subshard != 'general', forceSingleCore: subshard != 'general',
testPaths: <String>[path.join(kTest, '$subshard$kDotShard', suffix)], testPaths: <String>[path.join(kTest, '$subshard$kDotShard', suffix)],
enableFlutterToolAsserts: subshard != 'general', enableFlutterToolAsserts: subshard != 'general',
// Detect unit test time regressions (poor time delay handling, etc).
perTestTimeout: (subshard == 'general') ? const Duration(seconds: 2) : null,
); );
}, },
); );

View File

@ -587,7 +587,7 @@ void main() {
expect(result.code, 1); expect(result.code, 1);
expect(result.message, contains('Device initialization has not completed.')); expect(result.message, contains('Device initialization has not completed.'));
expect(fakeVmServiceHost.hasRemainingExpectations, false); expect(fakeVmServiceHost.hasRemainingExpectations, false);
})); }), timeout: const Timeout(Duration(seconds: 15))); // https://github.com/flutter/flutter/issues/74539
testUsingContext('ResidentRunner can handle an reload-barred exception from hot reload', () => testbed.run(() async { testUsingContext('ResidentRunner can handle an reload-barred exception from hot reload', () => testbed.run(() async {
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[ fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[

View File

@ -58,6 +58,7 @@ void testUsingContext(
Map<Type, Generator> overrides = const <Type, Generator>{}, Map<Type, Generator> overrides = const <Type, Generator>{},
bool initializeFlutterRoot = true, bool initializeFlutterRoot = true,
String testOn, String testOn,
Timeout timeout,
bool skip, // should default to `false`, but https://github.com/dart-lang/test/issues/545 doesn't allow this bool skip, // should default to `false`, but https://github.com/dart-lang/test/issues/545 doesn't allow this
}) { }) {
if (overrides[FileSystem] != null && overrides[ProcessManager] == null) { if (overrides[FileSystem] != null && overrides[ProcessManager] == null) {
@ -174,7 +175,7 @@ void testUsingContext(
// BotDetector implementation in the overrides. // BotDetector implementation in the overrides.
BotDetector: overrides[BotDetector] ?? () => const AlwaysTrueBotDetector(), BotDetector: overrides[BotDetector] ?? () => const AlwaysTrueBotDetector(),
}); });
}, testOn: testOn, skip: skip); }, testOn: testOn, skip: skip, timeout: timeout);
} }
void _printBufferedErrors(AppContext testContext) { void _printBufferedErrors(AppContext testContext) {