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',
testPaths: <String>[path.join(kTest, '$subshard$kDotShard', suffix)],
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.message, contains('Device initialization has not completed.'));
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 {
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[

View File

@ -58,6 +58,7 @@ void testUsingContext(
Map<Type, Generator> overrides = const <Type, Generator>{},
bool initializeFlutterRoot = true,
String testOn,
Timeout timeout,
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) {
@ -174,7 +175,7 @@ void testUsingContext(
// BotDetector implementation in the overrides.
BotDetector: overrides[BotDetector] ?? () => const AlwaysTrueBotDetector(),
});
}, testOn: testOn, skip: skip);
}, testOn: testOn, skip: skip, timeout: timeout);
}
void _printBufferedErrors(AppContext testContext) {