diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java index 82f2439904..83c8edc1c4 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java @@ -502,7 +502,7 @@ private void maybeWaitForInflightQuota() { @VisibleForTesting static long calculateSleepTimeMilli(long retryCount) { - return Math.min((long) Math.pow(2, retryCount), 60000); + return Math.min((long) Math.pow(2, retryCount) * 1000, 60000); } @VisibleForTesting diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java index e548c2b1b8..b0266adc56 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java @@ -502,8 +502,8 @@ public void testStreamNameMismatch() throws Exception { @Test public void testExponentialBackoff() throws Exception { - assertThat(ConnectionWorker.calculateSleepTimeMilli(0)).isEqualTo(1); - assertThat(ConnectionWorker.calculateSleepTimeMilli(5)).isEqualTo(32); + assertThat(ConnectionWorker.calculateSleepTimeMilli(0)).isEqualTo(1000); + assertThat(ConnectionWorker.calculateSleepTimeMilli(5)).isEqualTo(32000); assertThat(ConnectionWorker.calculateSleepTimeMilli(100)).isEqualTo(60000); }