Fix flakiness of commands_test (#11705)

- Wait for full Hot Reload
- Wait for full Restart
- Fallback if checkHealth throws METHOD_NOT_FOUND.
  We try to wait for the service extensions to be registered and retry.
This commit is contained in:
Carlo Bernaschina
2017-08-21 13:21:00 -07:00
committed by GitHub
parent 79d08f683a
commit 937b98e1b9
3 changed files with 48 additions and 23 deletions

View File

@@ -77,15 +77,21 @@ void main() {
await driver.drive('none');
final Future<String> reloadStartingText =
stdout.stream.firstWhere((String line) => line.endsWith('hot reload...'));
final Future<String> reloadEndingText =
stdout.stream.firstWhere((String line) => line.contains('Hot reload performed in '));
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('full restart...'));
final Future<String> restartEndingText =
stdout.stream.firstWhere((String line) => line.contains('Restart performed in '));
print('test: pressing "R" to perform a full reload...');
run.stdin.write('R');
await restartStartingText;
await restartEndingText;
await driver.drive('none');
run.stdin.write('q');
final int result = await run.exitCode;

View File

@@ -125,7 +125,6 @@ tasks:
Runs tests of flutter run commands.
stage: devicelab
required_agent_capabilities: ["has-android-device"]
flaky: true
android_sample_catalog_generator:
description: >