Skip to content

Commit

Permalink
chore: make rate clearer.
Browse files Browse the repository at this point in the history
  • Loading branch information
hessjcg committed Jul 19, 2023
1 parent bf8ce8f commit bdcab1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,6 @@ CloudSqlInstance getCloudSqlInstance(String instanceName, AuthType authType) {
credentialFactory,
executor,
localKeyPair,
RateLimiter.create(2.0 / 60.0))); // 2 refresh attempts per minute
RateLimiter.create(1.0 / 30.0))); // 1 refresh attempt every 30 seconds
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testCloudSqlInstanceDataRetrievedSuccessfully() throws Exception {
stubCredentialFactory,
executorService,
keyPairFuture,
RateLimiter.create(2.0 / 60.0));
RateLimiter.create(1.0 / 30.0));

SslData gotSslData = instance.getSslData();
assertThat(gotSslData).isSameInstanceAs(instanceDataSupplier.response.getSslData());
Expand Down Expand Up @@ -110,7 +110,7 @@ public void testInstanceFailsOnConnectionError() throws Exception {
stubCredentialFactory,
executorService,
keyPairFuture,
RateLimiter.create(2.0 / 60.0));
RateLimiter.create(1.0 / 30.0));

RuntimeException ex = Assert.assertThrows(RuntimeException.class, instance::getSslData);
assertThat(ex).hasMessageThat().contains("always fails");
Expand Down Expand Up @@ -138,7 +138,7 @@ public void testCloudSqlInstanceForcesRefresh() throws Exception {
stubCredentialFactory,
executorService,
keyPairFuture,
RateLimiter.create(2.0 / 60.0));
RateLimiter.create(1.0 / 30.0));

SslData gotSslData = instance.getSslData();
assertThat(gotSslData).isSameInstanceAs(sslData);
Expand Down Expand Up @@ -178,7 +178,7 @@ public void testGetPreferredIpTypes() throws Exception {
stubCredentialFactory,
executorService,
keyPairFuture,
RateLimiter.create(2.0 / 60.0));
RateLimiter.create(1.0 / 30.0));

assertThat(instance.getPreferredIp(Arrays.asList("PUBLIC", "PRIVATE"))).isEqualTo("10.1.2.3");
assertThat(instance.getPreferredIp(Arrays.asList("PUBLIC"))).isEqualTo("10.1.2.3");
Expand Down Expand Up @@ -215,7 +215,7 @@ public void testGetPreferredIpTypesThrowsException() throws Exception {
stubCredentialFactory,
executorService,
keyPairFuture,
RateLimiter.create(2.0 / 60.0));
RateLimiter.create(1.0 / 30.0));
Assert.assertThrows(
IllegalArgumentException.class, () -> instance.getPreferredIp(Arrays.asList("PRIVATE")));
}
Expand Down

0 comments on commit bdcab1d

Please sign in to comment.