diff options
author | Stas Negara <snegara@google.com> | 2015-05-15 15:11:07 -0700 |
---|---|---|
committer | Stas Negara <snegara@google.com> | 2015-05-15 15:13:23 -0700 |
commit | a859a817e97800bc01f96d11c0aa74830c9e5811 (patch) | |
tree | 4e96227b4814e5c898f04f4d222b6539b7bc0ac0 | |
parent | 944e134e72f9517dbc759c26306099d972bfdafb (diff) | |
download | testing-a859a817e97800bc01f96d11c0aa74830c9e5811.tar.gz |
Stop polling for launching cloud device if an error happens.
Change-Id: Ie9524d4fdc674cc6a2880fff696d207b9697e4eb
-rw-r--r-- | src/com/google/gct/testing/CloudConfigurationProviderImpl.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/google/gct/testing/CloudConfigurationProviderImpl.java b/src/com/google/gct/testing/CloudConfigurationProviderImpl.java index 64a206f..10eaada 100644 --- a/src/com/google/gct/testing/CloudConfigurationProviderImpl.java +++ b/src/com/google/gct/testing/CloudConfigurationProviderImpl.java @@ -319,6 +319,11 @@ public class CloudConfigurationProviderImpl extends CloudConfigurationProvider { while (System.currentTimeMillis() < stopTime) { createdDevice = getTest().projects().devices().get(lastCloudProjectId, createdDevice.getId()).execute(); System.out.println("Polling for device... (time: " + System.currentTimeMillis() + ", status: " + createdDevice.getState() + ")"); + if (createdDevice.getState().equals("DEVICE_ERROR")) { + CloudTestingUtils.showErrorMessage(null, "Error launching a cloud device", "Failed to launch a cloud device!\n" + + "The polled cloud device has ERROR state\n\n"); + return; + } if (createdDevice.getState().equals("READY")) { //if (createdDevice.getDeviceDetails().getConnectionInfo() != null) { String ipAddress = createdDevice.getDeviceDetails().getConnectionInfo().getIpAddress(); |