Skip to content

Commit c8d1d57

Browse files
committed
chore(spanner): revert skipped tests to another PR
1 parent 4745c3e commit c8d1d57

File tree

2 files changed

+11
-34
lines changed

2 files changed

+11
-34
lines changed

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

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,17 @@ public void clearRequests() {
6161
@Test
6262
public void testAsyncRunner_doesNotReturnCommitTimestampBeforeCommit() {
6363
AsyncRunner runner = client().runAsync();
64-
if (isMultiplexedSessionsEnabledForRW()) {
65-
ExecutionException e =
66-
assertThrows(ExecutionException.class, () -> runner.getCommitTimestamp().get());
67-
Throwable cause = e.getCause();
68-
assertTrue(cause instanceof IllegalStateException);
69-
assertTrue(cause.getMessage().contains("runAsync() has not yet been called"));
70-
} else {
71-
IllegalStateException e =
72-
assertThrows(IllegalStateException.class, () -> runner.getCommitTimestamp());
73-
assertTrue(e.getMessage().contains("runAsync() has not yet been called"));
74-
}
64+
IllegalStateException e =
65+
assertThrows(IllegalStateException.class, () -> runner.getCommitTimestamp());
66+
assertTrue(e.getMessage().contains("runAsync() has not yet been called"));
7567
}
7668

7769
@Test
7870
public void testAsyncRunner_doesNotReturnCommitResponseBeforeCommit() {
7971
AsyncRunner runner = client().runAsync();
80-
if (isMultiplexedSessionsEnabledForRW()) {
81-
ExecutionException e =
82-
assertThrows(ExecutionException.class, () -> runner.getCommitResponse().get());
83-
Throwable cause = e.getCause();
84-
assertTrue(cause instanceof IllegalStateException);
85-
assertTrue(cause.getMessage().contains("runAsync() has not yet been called"));
86-
} else {
87-
IllegalStateException e =
88-
assertThrows(IllegalStateException.class, () -> runner.getCommitResponse());
89-
assertTrue(e.getMessage().contains("runAsync() has not yet been called"));
90-
}
72+
IllegalStateException e =
73+
assertThrows(IllegalStateException.class, () -> runner.getCommitResponse());
74+
assertTrue(e.getMessage().contains("runAsync() has not yet been called"));
9175
}
9276

9377
@Test
@@ -524,8 +508,6 @@ public void asyncRunnerWaitsUntilAsyncBatchUpdateHasFinished() throws Exception
524508

525509
@Test
526510
public void closeTransactionBeforeEndOfAsyncQuery() throws Exception {
527-
// TODO(sriharshach): Fix this unittest
528-
assumeFalse("Skipping for mux", isMultiplexedSessionsEnabledForRW());
529511
final BlockingQueue<String> results = new SynchronousQueue<>();
530512
final SettableApiFuture<Boolean> finished = SettableApiFuture.create();
531513
DatabaseClientImpl clientImpl = (DatabaseClientImpl) client();

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,6 @@ public void asyncTransactionManagerUpdate() throws Exception {
251251

252252
@Test
253253
public void asyncTransactionManagerIsNonBlocking() throws Exception {
254-
// TODO: Remove this condition once DelayedAsyncTransactionManager is made non-blocking with
255-
// multiplexed sessions.
256-
assumeFalse(
257-
"DelayedAsyncTransactionManager is currently blocking with multiplexed sessions.",
258-
spanner.getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW());
259254
mockSpanner.freeze();
260255
try (AsyncTransactionManager manager = clientWithEmptySessionPool().transactionManagerAsync()) {
261256
TransactionContextFuture transactionContextFuture = manager.beginAsync();
@@ -639,11 +634,6 @@ public void asyncTransactionManagerBatchUpdate() throws Exception {
639634

640635
@Test
641636
public void asyncTransactionManagerIsNonBlockingWithBatchUpdate() throws Exception {
642-
// TODO: Remove this condition once DelayedAsyncTransactionManager is made non-blocking with
643-
// multiplexed sessions.
644-
assumeFalse(
645-
"DelayedAsyncTransactionManager is currently blocking with multiplexed sessions.",
646-
spanner.getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW());
647637
mockSpanner.freeze();
648638
try (AsyncTransactionManager manager = clientWithEmptySessionPool().transactionManagerAsync()) {
649639
TransactionContextFuture transactionContextFuture = manager.beginAsync();
@@ -952,6 +942,11 @@ public void asyncTransactionManagerBatchUpdateAbortedWithoutGettingResult() thro
952942
}
953943
assertThat(attempt.get()).isEqualTo(2);
954944
List<Class<? extends AbstractMessage>> requests = mockSpanner.getRequestTypes();
945+
// Remove the CreateSession requests for multiplexed sessions, as those are not relevant for
946+
// this test if multiplexed session for read-write is not enabled.
947+
if (!isMultiplexedSessionsEnabledForRW()){
948+
requests.removeIf(request -> request == CreateSessionRequest.class);
949+
}
955950
int size = Iterables.size(requests);
956951
assertThat(size).isIn(Range.closed(5, 6));
957952
if (size == 5) {

0 commit comments

Comments
 (0)