[O] Removing all timeouts (mark II) (#26736)

These are essentially self-inflicted race conditions. Instead of timeouts we're going to try a more verbose logging mechanism that points out when things are taking a long time.
This commit is contained in:
Ian Hickson
2019-01-19 00:31:05 -08:00
committed by GitHub
parent fa79c8137d
commit 31a9626c48
70 changed files with 2122 additions and 1360 deletions

View File

@@ -119,7 +119,7 @@ Notably, it will start and stop gradle, for instance.
To run all tests defined in `manifest.yaml`, use option `-a` (`--all`):
```sh
dart bin/run.dart -a
../../bin/cache/dart-sdk/bin/dart bin/run.dart -a
```
## Running specific tests
@@ -128,7 +128,7 @@ To run a test, use option `-t` (`--task`):
```sh
# from the .../flutter/dev/devicelab directory
dart bin/run.dart -t {NAME_OR_PATH_OF_TEST}
../../bin/cache/dart-sdk/bin/dart bin/run.dart -t {NAME_OR_PATH_OF_TEST}
```
Where `NAME_OR_PATH_OF_TEST` can be either of:
@@ -142,7 +142,7 @@ Where `NAME_OR_PATH_OF_TEST` can be either of:
To run multiple tests, repeat option `-t` (`--task`) multiple times:
```sh
dart bin/run.dart -t test1 -t test2 -t test3
../../bin/cache/dart-sdk/bin/dart bin/run.dart -t test1 -t test2 -t test3
```
To run tests from a specific stage, use option `-s` (`--stage`).
@@ -151,7 +151,7 @@ Currently there are only three stages defined, `devicelab`,
```sh
dart bin/run.dart -s {NAME_OF_STAGE}
../../bin/cache/dart-sdk/bin/dart bin/run.dart -s {NAME_OF_STAGE}
```
# Reproducing broken builds locally
@@ -162,7 +162,7 @@ failing test is `flutter_gallery__transition_perf`. This name can be passed to
the `run.dart` command. For example:
```sh
dart bin/run.dart -t flutter_gallery__transition_perf
../../bin/cache/dart-sdk/bin/dart bin/run.dart -t flutter_gallery__transition_perf
```
# Writing tests

View File

@@ -74,18 +74,18 @@ void main() {
run.stdin.write('P');
await driver.drive('none');
final Future<String> reloadStartingText =
stdout.stream.firstWhere((String line) => line.endsWith('hot reload...'));
stdout.stream.firstWhere((String line) => line.endsWith('] Initializing hot reload...'));
final Future<String> reloadEndingText =
stdout.stream.firstWhere((String line) => line.contains('Hot reload performed in '));
stdout.stream.firstWhere((String line) => line.contains('] Reloaded ') && line.endsWith('ms.'));
print('test: pressing "r" to perform a hot reload...');
run.stdin.write('r');
await reloadStartingText;
await reloadEndingText;
await driver.drive('none');
final Future<String> restartStartingText =
stdout.stream.firstWhere((String line) => line.endsWith('hot restart...'));
stdout.stream.firstWhere((String line) => line.endsWith('Performing hot restart...'));
final Future<String> restartEndingText =
stdout.stream.firstWhere((String line) => line.contains('Hot restart performed in '));
stdout.stream.firstWhere((String line) => line.contains('] Restarted application in '));
print('test: pressing "R" to perform a full reload...');
run.stdin.write('R');
await restartStartingText;

View File

@@ -29,7 +29,7 @@ Future<void> main() async {
final SerializableFinder summary = find.byValueKey('summary');
// Wait for calibration to complete and fab to appear.
await driver.waitFor(fab, timeout: const Duration(seconds: 40));
await driver.waitFor(fab);
final String calibrationResult = await driver.getText(summary);
final Match matchCalibration = calibrationRegExp.matchAsPrefix(calibrationResult);
@@ -59,7 +59,7 @@ Future<void> main() async {
expect(double.parse(matchFast.group(1)), closeTo(flutterFrameRate * 2.0, 5.0));
expect(double.parse(matchFast.group(2)), closeTo(flutterFrameRate, 10.0));
expect(int.parse(matchFast.group(3)), 1);
}, timeout: const Timeout(Duration(minutes: 1)));
});
tearDownAll(() async {
driver?.close();