Skip to content

Commit 66d258f

Browse files
committed
chore(spanner): lint fix and remove sleep
1 parent 4801373 commit 66d258f

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class DatabaseClientImpl implements DatabaseClient {
5959
/* useMultiplexedSessionBlindWrite = */ false,
6060
/* multiplexedSessionDatabaseClient = */ null,
6161
tracer,
62-
false);
62+
/* useMultiplexedSessionForRW = */ false);
6363
}
6464

6565
DatabaseClientImpl(

google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -752,18 +752,16 @@ public void testAsyncRunnerIsNonBlockingWithMultiplexedSession() throws Exceptio
752752
assertEquals(1L, client.multiplexedSessionDatabaseClient.getNumSessionsAcquired().get());
753753
assertEquals(1L, client.multiplexedSessionDatabaseClient.getNumSessionsReleased().get());
754754
}
755-
755+
756756
@Test
757-
public void testAbortedReadWriteTxnUsesPreviousTxnIdOnRetryWithInlineBegin()
758-
throws InterruptedException {
757+
public void testAbortedReadWriteTxnUsesPreviousTxnIdOnRetryWithInlineBegin() {
759758
DatabaseClientImpl client =
760759
(DatabaseClientImpl) spanner.getDatabaseClient(DatabaseId.of("p", "i", "d"));
761760
// Force the Commit RPC to return Aborted the first time it is called. The exception is cleared
762761
// after the first call, so the retry should succeed.
763762
mockSpanner.setCommitExecutionTime(
764763
SimulatedExecutionTime.ofException(
765764
mockSpanner.createAbortedException(ByteString.copyFromUtf8("test"))));
766-
Thread.sleep(10000);
767765
TransactionRunner runner = client.readWriteTransaction();
768766
AtomicReference<ByteString> validTransactionId = new AtomicReference<>();
769767
runner.run(
@@ -840,18 +838,16 @@ public void testAbortedReadWriteTxnUsesPreviousTxnIdOnRetryWithInlineBegin()
840838
.getReadWrite()
841839
.getMultiplexedSessionPreviousTransactionId());
842840
}
843-
841+
844842
@Test
845-
public void testAbortedReadWriteTxnUsesPreviousTxnIdOnRetryWithExplicitBegin()
846-
throws InterruptedException {
843+
public void testAbortedReadWriteTxnUsesPreviousTxnIdOnRetryWithExplicitBegin() {
847844
DatabaseClientImpl client =
848845
(DatabaseClientImpl) spanner.getDatabaseClient(DatabaseId.of("p", "i", "d"));
849846
// Force the Commit RPC to return Aborted the first time it is called. The exception is cleared
850847
// after the first call, so the retry should succeed.
851848
mockSpanner.setCommitExecutionTime(
852849
SimulatedExecutionTime.ofException(
853850
mockSpanner.createAbortedException(ByteString.copyFromUtf8("test"))));
854-
Thread.sleep(10000);
855851
TransactionRunner runner = client.readWriteTransaction();
856852
AtomicReference<ByteString> validTransactionId = new AtomicReference<>();
857853
Long updateCount =

0 commit comments

Comments
 (0)