diff options
Diffstat (limited to 'plugins/TestRunner/Aws/Instance.php')
-rw-r--r-- | plugins/TestRunner/Aws/Instance.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/TestRunner/Aws/Instance.php b/plugins/TestRunner/Aws/Instance.php index 769b35b337..77f21253c8 100644 --- a/plugins/TestRunner/Aws/Instance.php +++ b/plugins/TestRunner/Aws/Instance.php @@ -126,12 +126,17 @@ class Instance public function verifySetup($instanceIds) { $awsCloudWatch = new CloudWatch($this->config); - $hasAlarms = $awsCloudWatch->hasAssignedAlarms($instanceIds); + $hasAlarms = $awsCloudWatch->hasAssignedAlarms($instanceIds); if (!$hasAlarms) { - return $this->setup($instanceIds); - } + $this->setup($instanceIds); // try setup again + + $hasAlarms = $awsCloudWatch->hasAssignedAlarms($instanceIds); + if (!$hasAlarms) { // declare it as failed if it still does not work + throw new \Exception('Failed to assign alarms for InstanceIds: ' . implode(', ' , $instanceIds)); + } + } } /** |