@@ -91,10 +91,7 @@ public boolean doCreateDefaultTestTable() {
9191 @ Before
9292 public void clearTable () {
9393 try (ITConnection connection = createConnection ()) {
94- connection .execute (Statement .of ("SELECT 1" ));
95- connection .commit ();
9694 connection .bufferedWrite (Mutation .delete ("TEST" , KeySet .all ()));
97- //connection.executeUpdate(Statement.of("DELETE FROM TEST WHERE TRUE"));
9895 get (connection .commitAsync ());
9996 }
10097 }
@@ -224,7 +221,8 @@ public void testCommitAborted() {
224221 AbortInterceptor interceptor = new AbortInterceptor (0 );
225222 try (ITConnection connection =
226223 createConnection (interceptor , new CountTransactionRetryListener ())) {
227- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
224+ interceptor .setUsingMultiplexedSession (
225+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
228226 ApiFuture <Long > count = getTestRecordCountAsync (connection );
229227 // do an insert
230228 ApiFuture <Long > updateCount =
@@ -257,7 +255,8 @@ public void testInsertAborted() {
257255 AbortInterceptor interceptor = new AbortInterceptor (0 );
258256 try (ITConnection connection =
259257 createConnection (interceptor , new CountTransactionRetryListener ())) {
260- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
258+ interceptor .setUsingMultiplexedSession (
259+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
261260 ApiFuture <Long > count = getTestRecordCountAsync (connection );
262261 // indicate that the next statement should abort
263262 interceptor .setProbability (1.0 );
@@ -281,7 +280,8 @@ public void testUpdateAborted() {
281280 AbortInterceptor interceptor = new AbortInterceptor (0 );
282281 try (ITConnection connection =
283282 createConnection (interceptor , new CountTransactionRetryListener ())) {
284- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
283+ interceptor .setUsingMultiplexedSession (
284+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
285285 ApiFuture <Long > count = getTestRecordCountAsync (connection );
286286 // insert a test record
287287 connection .executeUpdateAsync (
@@ -315,7 +315,8 @@ public void testQueryAborted() {
315315 AbortInterceptor interceptor = new AbortInterceptor (0 );
316316 try (ITConnection connection =
317317 createConnection (interceptor , new CountTransactionRetryListener ())) {
318- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
318+ interceptor .setUsingMultiplexedSession (
319+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
319320 // insert a test record
320321 connection .executeUpdateAsync (
321322 Statement .of ("INSERT INTO TEST (ID, NAME) VALUES (1, 'test aborted')" ));
@@ -366,7 +367,8 @@ public void testNextCallAborted() {
366367 AbortInterceptor interceptor = new AbortInterceptor (0 );
367368 try (ITConnection connection =
368369 createConnection (interceptor , new CountTransactionRetryListener ())) {
369- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
370+ interceptor .setUsingMultiplexedSession (
371+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
370372 // insert two test records
371373 connection .executeUpdateAsync (
372374 Statement .of ("INSERT INTO TEST (ID, NAME) VALUES (1, 'test 1')" ));
@@ -400,7 +402,8 @@ public void testMultipleAborts() {
400402 AbortInterceptor interceptor = new AbortInterceptor (0 );
401403 try (ITConnection connection =
402404 createConnection (interceptor , new CountTransactionRetryListener ())) {
403- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
405+ interceptor .setUsingMultiplexedSession (
406+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
404407 ApiFuture <Long > count = getTestRecordCountAsync (connection );
405408 // do three inserts which all will abort and retry
406409 interceptor .setProbability (1.0 );
@@ -437,7 +440,8 @@ public void testAbortAfterSelect() {
437440 AbortInterceptor interceptor = new AbortInterceptor (0 );
438441 try (ITConnection connection =
439442 createConnection (interceptor , new CountTransactionRetryListener ())) {
440- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
443+ interceptor .setUsingMultiplexedSession (
444+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
441445 ApiFuture <Long > count = getTestRecordCountAsync (connection );
442446 // insert a test record
443447 connection .executeUpdateAsync (
@@ -514,7 +518,8 @@ public void testAbortWithResultSetHalfway() {
514518 AbortInterceptor interceptor = new AbortInterceptor (0 );
515519 try (ITConnection connection =
516520 createConnection (interceptor , new CountTransactionRetryListener ())) {
517- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
521+ interceptor .setUsingMultiplexedSession (
522+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
518523 // insert two test records
519524 connection .executeUpdateAsync (
520525 Statement .of ("INSERT INTO TEST (ID, NAME) VALUES (1, 'test 1')" ));
@@ -550,7 +555,8 @@ public void testAbortWithResultSetFullyConsumed() {
550555 AbortInterceptor interceptor = new AbortInterceptor (0 );
551556 try (ITConnection connection =
552557 createConnection (interceptor , new CountTransactionRetryListener ())) {
553- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
558+ interceptor .setUsingMultiplexedSession (
559+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
554560 // insert two test records
555561 connection .executeUpdateAsync (
556562 Statement .of ("INSERT INTO TEST (ID, NAME) VALUES (1, 'test 1')" ));
@@ -593,7 +599,8 @@ public void testAbortWithConcurrentInsert() {
593599 AbortInterceptor interceptor = new AbortInterceptor (0 );
594600 try (ITConnection connection =
595601 createConnection (interceptor , new CountTransactionRetryListener ())) {
596- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
602+ interceptor .setUsingMultiplexedSession (
603+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
597604 // insert two test records
598605 connection .executeUpdateAsync (
599606 Statement .of ("INSERT INTO TEST (ID, NAME) VALUES (1, 'test 1')" ));
@@ -645,7 +652,8 @@ public void testAbortWithConcurrentDelete() {
645652 AbortInterceptor interceptor = new AbortInterceptor (0 );
646653 // first insert two test records
647654 try (ITConnection connection = createConnection ()) {
648- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
655+ interceptor .setUsingMultiplexedSession (
656+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
649657 connection .executeUpdateAsync (
650658 Statement .of ("INSERT INTO TEST (ID, NAME) VALUES (1, 'test 1')" ));
651659 connection .executeUpdateAsync (
@@ -655,7 +663,8 @@ public void testAbortWithConcurrentDelete() {
655663 // open a new connection and select the two test records
656664 try (ITConnection connection =
657665 createConnection (interceptor , new CountTransactionRetryListener ())) {
658- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
666+ interceptor .setUsingMultiplexedSession (
667+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
659668 // select the test records and consume the entire result set
660669 try (AsyncResultSet rs =
661670 connection .executeQueryAsync (Statement .of ("SELECT * FROM TEST ORDER BY ID" ))) {
@@ -709,7 +718,8 @@ public void testAbortWithConcurrentUpdate() {
709718 // open a new connection and select the two test records
710719 try (ITConnection connection =
711720 createConnection (interceptor , new CountTransactionRetryListener ())) {
712- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
721+ interceptor .setUsingMultiplexedSession (
722+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
713723 // select the test records and consume the entire result set
714724 try (AsyncResultSet rs =
715725 connection .executeQueryAsync (Statement .of ("SELECT * FROM TEST ORDER BY ID" ))) {
@@ -760,7 +770,8 @@ public void testAbortWithUnseenConcurrentInsert() throws InterruptedException {
760770 AbortInterceptor interceptor = new AbortInterceptor (0 );
761771 try (ITConnection connection =
762772 createConnection (interceptor , new CountTransactionRetryListener ())) {
763- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
773+ interceptor .setUsingMultiplexedSession (
774+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
764775 // insert three test records
765776 connection .executeUpdateAsync (
766777 Statement .of ("INSERT INTO TEST (ID, NAME) VALUES (1, 'test 1')" ));
@@ -850,7 +861,8 @@ public void testRetryLargeResultSet() {
850861 final long UPDATED_RECORDS = 1000L ;
851862 AbortInterceptor interceptor = new AbortInterceptor (0 );
852863 try (ITConnection connection = createConnection ()) {
853- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
864+ interceptor .setUsingMultiplexedSession (
865+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
854866 // insert test records
855867 for (int i = 0 ; i < NUMBER_OF_TEST_RECORDS ; i ++) {
856868 connection .bufferedWrite (
@@ -863,7 +875,8 @@ public void testRetryLargeResultSet() {
863875 }
864876 try (ITConnection connection =
865877 createConnection (interceptor , new CountTransactionRetryListener ())) {
866- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
878+ interceptor .setUsingMultiplexedSession (
879+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
867880 // select the test records and iterate over them
868881 try (AsyncResultSet rs =
869882 connection .executeQueryAsync (Statement .of ("SELECT * FROM TEST ORDER BY ID" ))) {
@@ -886,7 +899,8 @@ public void testRetryLargeResultSet() {
886899 // Wait until the entire result set has been consumed.
887900 get (finished );
888901 }
889- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
902+ interceptor .setUsingMultiplexedSession (
903+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
890904 // Do an update that will abort and retry.
891905 interceptor .setProbability (1.0 );
892906 interceptor .setOnlyInjectOnce (true );
@@ -918,7 +932,8 @@ public void testRetryHighAbortRate() {
918932 AbortInterceptor interceptor = new AbortInterceptor (0.25D );
919933 try (ITConnection connection =
920934 createConnection (interceptor , new CountTransactionRetryListener ())) {
921- interceptor .setUsingMultiplexedSession (isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
935+ interceptor .setUsingMultiplexedSession (
936+ isMultiplexedSessionsEnabledForRW (connection .getSpanner ()));
922937 // insert test records
923938 for (int i = 0 ; i < NUMBER_OF_TEST_RECORDS ; i ++) {
924939 connection .bufferedWrite (
0 commit comments