From 93187255de8581cfb86d3d936475ed73b871b56b Mon Sep 17 00:00:00 2001 From: kolea2 <45548808+kolea2@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:35:00 -0500 Subject: [PATCH] test: add catch blocks to autoscaling tests (#1113) * test: add catch blocks to autoscaling tests * lint --- .../admin/v2/it/BigtableInstanceAdminClientIT.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java index 8496561676..fcb9c36b62 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java @@ -37,6 +37,7 @@ import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import java.util.List; +import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; @@ -314,6 +315,8 @@ public void createClusterWithAutoscalingTest() { assertThat(cluster.getAutoscalingMinServeNodes()).isEqualTo(1); assertThat(cluster.getAutoscalingMaxServeNodes()).isEqualTo(4); assertThat(cluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); + } catch (Exception e) { + Assert.fail("error in the test" + e.getMessage()); } finally { client.deleteInstance(newInstanceId); } @@ -379,6 +382,8 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() { assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(5); assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(45); + } catch (Exception e) { + Assert.fail("error in the test: " + e.getMessage()); } finally { client.deleteInstance(newInstanceId); } @@ -409,6 +414,8 @@ public void createClusterWithManualScalingTest() { assertThat(cluster.getAutoscalingMaxServeNodes()).isEqualTo(0); assertThat(cluster.getAutoscalingMinServeNodes()).isEqualTo(0); assertThat(cluster.getAutoscalingCpuPercentageTarget()).isEqualTo(0); + } catch (Exception e) { + Assert.fail("error in the test: " + e.getMessage()); } finally { client.deleteInstance(newInstanceId); }