From e444eb04d11ff5b3546249aa51c74f39b9393857 Mon Sep 17 00:00:00 2001 From: Keqiu Hu Date: Fri, 17 Mar 2017 14:56:53 -0700 Subject: [PATCH] Fix If there is an error launching the app and tests, new simulators continue to spawn infinitely #100 --- Bluepill-cli/Bluepill-cli/Bluepill/Bluepill.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Bluepill-cli/Bluepill-cli/Bluepill/Bluepill.m b/Bluepill-cli/Bluepill-cli/Bluepill/Bluepill.m index 9fa6ad85..2f0dfa9d 100644 --- a/Bluepill-cli/Bluepill-cli/Bluepill/Bluepill.m +++ b/Bluepill-cli/Bluepill-cli/Bluepill/Bluepill.m @@ -197,7 +197,11 @@ - (void)setupExecutionWithContext:(BPExecutionContext *)context { context.runner = [self createSimulatorRunnerWithContext:context]; + // Set up retry counts. self.maxCreateTries = [self.config.maxCreateTries integerValue]; + self.maxInstallTries = [self.config.maxInstallTries integerValue]; + self.maxLaunchTries = [self.config.maxLaunchTries integerValue]; + NEXT([self createSimulatorWithContext:context]); } @@ -249,7 +253,6 @@ - (void)createSimulatorWithContext:(BPExecutionContext *)context { [BPUtils printInfo:ERROR withString:[@"Timeout: " stringByAppendingString:stepName]]; }; - self.maxInstallTries = [self.config.maxInstallTries integerValue]; [context.runner createSimulatorWithDeviceName:deviceName completion:handler.defaultHandlerBlock]; } @@ -258,8 +261,6 @@ - (void)installApplicationWithContext:(BPExecutionContext *)context { [[BPStats sharedStats] startTimer:stepName]; [BPUtils printInfo:INFO withString:stepName]; - self.maxLaunchTries = [self.config.maxLaunchTries integerValue]; - NSError *error = nil; BOOL success = [context.runner installApplicationAndReturnError:&error];