Skip to content

Commit cdea4ba

Browse files
committed
chore(spanner): remove temp fixes
1 parent d754ec5 commit cdea4ba

File tree

7 files changed

+20
-73
lines changed

7 files changed

+20
-73
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITJsonWriteReadTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ public void testWriteAndReadInvalidJsonValues() throws IOException {
132132
.to(Value.json(jsonStr))
133133
.build())));
134134

135-
if(env.getTestHelper().getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW()) {
135+
if (env.getTestHelper()
136+
.getOptions()
137+
.getSessionPoolOptions()
138+
.getUseMultiplexedSessionForRW()) {
136139
assertEquals(ErrorCode.INVALID_ARGUMENT, exception.getErrorCode());
137140
} else {
138141
assertEquals(ErrorCode.FAILED_PRECONDITION, exception.getErrorCode());

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITLargeReadTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.util.Collections;
3939
import java.util.List;
4040
import java.util.Random;
41-
import java.util.concurrent.ThreadLocalRandom;
4241
import org.junit.AfterClass;
4342
import org.junit.BeforeClass;
4443
import org.junit.ClassRule;
@@ -102,11 +101,6 @@ public static void setUpDatabase() {
102101
+ ")"));
103102
postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase);
104103
hasher = Hashing.goodFastHash(64);
105-
try {
106-
Thread.sleep(10000);
107-
} catch (Exception e) {
108-
109-
}
110104
List<Mutation> mutations = new ArrayList<>();
111105
Random rnd = new Random();
112106
int totalSize = 0;

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,6 @@ public void setUp() throws Exception {
120120
+ "\" (id BIGINT PRIMARY KEY, col1 JSONB, colarray JSONB[])"),
121121
null)
122122
.get(OPERATION_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
123-
124-
databaseClient.readWriteTransaction().run(
125-
transaction -> {
126-
ResultSet rs = transaction.executeQuery(Statement.of("SELECT 1"));
127-
while (rs.next()) {
128-
// do nothing
129-
}
130-
return null;
131-
});
132123
}
133124

134125
@Test
@@ -421,14 +412,6 @@ public void testMutationsWithPgJsonbAsString() {
421412

422413
@Test
423414
public void testMutationsWithPgJsonbAsValue() {
424-
databaseClient.readWriteTransaction().run(
425-
transaction -> {
426-
ResultSet rs = transaction.executeQuery(Statement.of("SELECT 1"));
427-
while (rs.next()) {
428-
// do nothing
429-
}
430-
return null;
431-
});
432415
databaseClient
433416
.readWriteTransaction()
434417
.run(

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,6 @@ public void setUp() throws Exception {
108108
"CREATE TABLE \"" + tableName + "\" (id BIGINT PRIMARY KEY, col1 NUMERIC)"),
109109
null)
110110
.get(OPERATION_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
111-
112-
databaseClient.readWriteTransaction().run(
113-
transaction -> {
114-
ResultSet rs = transaction.executeQuery(Statement.of("SELECT 1"));
115-
while (rs.next()) {
116-
// do nothing
117-
}
118-
return null;
119-
});
120111
}
121112

122113
@Test
@@ -333,14 +324,6 @@ public void testMutationsWithPgNumericAsString() {
333324

334325
@Test
335326
public void testMutationsWithPgNumericAsInt() {
336-
databaseClient.readWriteTransaction().run(
337-
transaction -> {
338-
ResultSet rs = transaction.executeQuery(Statement.of("SELECT 1"));
339-
while (rs.next()) {
340-
// do nothing
341-
}
342-
return null;
343-
});
344327
databaseClient
345328
.readWriteTransaction()
346329
.run(
@@ -367,14 +350,6 @@ public void testMutationsWithPgNumericAsInt() {
367350

368351
@Test
369352
public void testMutationsWithPgNumericAsLong() {
370-
databaseClient.readWriteTransaction().run(
371-
transaction -> {
372-
ResultSet rs = transaction.executeQuery(Statement.of("SELECT 1"));
373-
while (rs.next()) {
374-
// do nothing
375-
}
376-
return null;
377-
});
378353
databaseClient
379354
.readWriteTransaction()
380355
.run(
@@ -401,14 +376,6 @@ public void testMutationsWithPgNumericAsLong() {
401376

402377
@Test
403378
public void testMutationsWithPgNumericAsBigDecimal() {
404-
databaseClient.readWriteTransaction().run(
405-
transaction -> {
406-
ResultSet rs = transaction.executeQuery(Statement.of("SELECT 1"));
407-
while (rs.next()) {
408-
// do nothing
409-
}
410-
return null;
411-
});
412379
databaseClient
413380
.readWriteTransaction()
414381
.run(
@@ -446,14 +413,6 @@ public void testMutationsWithPgNumericAsBigDecimal() {
446413

447414
@Test
448415
public void testMutationsWithPgNumericAsValue() {
449-
databaseClient.readWriteTransaction().run(
450-
transaction -> {
451-
ResultSet rs = transaction.executeQuery(Statement.of("SELECT 1"));
452-
while (rs.next()) {
453-
// do nothing
454-
}
455-
return null;
456-
});
457416
databaseClient
458417
.readWriteTransaction()
459418
.run(

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITTransactionManagerAsyncTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ public void testInvalidInsert() throws InterruptedException {
161161
} catch (ExecutionException e) {
162162
assertThat(e.getCause()).isInstanceOf(SpannerException.class);
163163
SpannerException se = (SpannerException) e.getCause();
164-
if(env.getTestHelper().getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW()) {
164+
if (env.getTestHelper()
165+
.getOptions()
166+
.getSessionPoolOptions()
167+
.getUseMultiplexedSessionForRW()) {
165168
assertThat(se.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
166169
} else {
167170
assertThat(se.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITTransactionTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,6 @@ public void nestedTxnSucceedsWhenAllowed() {
471471
.run(
472472
transaction -> {
473473
client.singleUseReadOnlyTransaction();
474-
ResultSet rs = transaction.executeQuery(Statement.of("SELECT 1"));
475-
while(rs.next()) {
476-
// do nothing
477-
}
478474
return null;
479475
});
480476
}

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWriteTest.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,10 @@ public void tableNotFound() {
10431043
.build());
10441044
fail("Expected exception");
10451045
} catch (SpannerException ex) {
1046-
if (env.getTestHelper().getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW()) {
1046+
if (env.getTestHelper()
1047+
.getOptions()
1048+
.getSessionPoolOptions()
1049+
.getUseMultiplexedSessionForRW()) {
10471050
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
10481051
} else {
10491052
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
@@ -1057,7 +1060,10 @@ public void columnNotFound() {
10571060
write(baseInsert().set("ColumnThatDoesNotExist").to("V1").build());
10581061
fail("Expected exception");
10591062
} catch (SpannerException ex) {
1060-
if (env.getTestHelper().getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW()) {
1063+
if (env.getTestHelper()
1064+
.getOptions()
1065+
.getSessionPoolOptions()
1066+
.getUseMultiplexedSessionForRW()) {
10611067
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
10621068
} else {
10631069
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
@@ -1071,7 +1077,10 @@ public void incorrectType() {
10711077
write(baseInsert().set("StringValue").to(1.234).build());
10721078
fail("Expected exception");
10731079
} catch (SpannerException ex) {
1074-
if (env.getTestHelper().getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW()) {
1080+
if (env.getTestHelper()
1081+
.getOptions()
1082+
.getSessionPoolOptions()
1083+
.getUseMultiplexedSessionForRW()) {
10751084
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
10761085
} else {
10771086
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.FAILED_PRECONDITION);

0 commit comments

Comments
 (0)