public void testCreateVolume() throws Exception {
try {
volume = connection.createVolumeInLocation(location.getId(), GROUP, FORMAT, cheapestStorage.getName(),
cheapestStorage.getId());
// wait up to 5 minutes for this to become "unmounted"
assert new RetryablePredicate<Volume>(new VolumeUnmounted(connection), 300, 5, TimeUnit.SECONDS).apply(volume);
} catch (IllegalStateException e) {
int code = HttpResponseException.class.cast(e.getCause()).getResponse().getStatusCode();
if (code == 409 || code == 500) {
Set<? extends Volume> volumes = connection.listVolumes();
try {