Skip to content

Commit

Permalink
test: add catch blocks to autoscaling tests (#1113)
Browse files Browse the repository at this point in the history
* test: add catch blocks to autoscaling tests

* lint
  • Loading branch information
kolea2 authored Dec 23, 2021
1 parent cebbbcf commit 9318725
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 9318725

Please sign in to comment.