diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-11-13 00:11:31 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-11-13 00:11:31 +0300 |
commit | 9ddd7b484acdcddb077e6cf8c7a301231c6bee84 (patch) | |
tree | dc26a81c7e4972d35438a4856736be3b83630e7c /plugins | |
parent | 03d40b9fe7ba5f8b9637edc8d83bf33503086793 (diff) |
also make sure AWS was set up correctly when launching a new instance
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/TestRunner/Aws/Instance.php | 11 | ||||
-rw-r--r-- | plugins/TestRunner/Runner/InstanceLauncher.php | 1 |
2 files changed, 9 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)); + } + } } /** diff --git a/plugins/TestRunner/Runner/InstanceLauncher.php b/plugins/TestRunner/Runner/InstanceLauncher.php index 4f9faf97c7..a041cd0471 100644 --- a/plugins/TestRunner/Runner/InstanceLauncher.php +++ b/plugins/TestRunner/Runner/InstanceLauncher.php @@ -40,6 +40,7 @@ class InstanceLauncher { try { $host = $this->instance->setup($instanceIds); + $this->instance->verifySetup($instanceIds); } catch (\Exception $e) { $this->instance->terminate($instanceIds); |