Skip to content

Commit

Permalink
Added delay after booting simulator to avoid simulator race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcc007 committed Jul 23, 2019
1 parent ae76861 commit 88d8d10
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/run.dart
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,13 @@ Future runProcessTests(
Future<void> shutdownSimulator(String deviceId) async {
cmd('xcrun', ['simctl', 'shutdown', deviceId]);
// shutdown apparently needs time when restarting
// see https://github.com/flutter/flutter/issues/10228 for race condition on simulator
await Future.delayed(Duration(milliseconds: 2000));
}

Future<void> startSimulator(DaemonClient daemonClient, String deviceId) async {
cmd('xcrun', ['simctl', 'boot', deviceId]);
await Future.delayed(Duration(milliseconds: 2000));
await waitForEmulatorToStart(daemonClient, deviceId);
}

Expand Down

0 comments on commit 88d8d10

Please sign in to comment.