@@ -63,6 +63,11 @@ public void testAsyncRunner_doesNotReturnCommitTimestampBeforeCommit() {
6363 AsyncRunner runner = client ().runAsync ();
6464 if (isMultiplexedSessionsEnabledForRW ()) {
6565 Throwable e = assertThrows (Throwable .class , () -> runner .getCommitTimestamp ().get ());
66+ // If the error occurs within the future, it gets wrapped in an ExecutionException.
67+ // This happens when DelayedAsyncRunner is invoked while the multiplexed session is not yet
68+ // created.
69+ // If the error occurs before the future is created, it may throw an IllegalStateException
70+ // instead.
6671 assertTrue (e instanceof ExecutionException || e instanceof IllegalStateException );
6772 if (e instanceof ExecutionException ) {
6873 Throwable cause = e .getCause ();
@@ -83,6 +88,11 @@ public void testAsyncRunner_doesNotReturnCommitResponseBeforeCommit() {
8388 AsyncRunner runner = client ().runAsync ();
8489 if (isMultiplexedSessionsEnabledForRW ()) {
8590 Throwable e = assertThrows (Throwable .class , () -> runner .getCommitResponse ().get ());
91+ // If the error occurs within the future, it gets wrapped in an ExecutionException.
92+ // This happens when DelayedAsyncRunner is invoked while the multiplexed session is not yet
93+ // created.
94+ // If the error occurs before the future is created, it may throw an IllegalStateException
95+ // instead.
8696 assertTrue (e instanceof ExecutionException || e instanceof IllegalStateException );
8797 if (e instanceof ExecutionException ) {
8898 Throwable cause = e .getCause ();
@@ -583,7 +593,7 @@ public void closeTransactionBeforeEndOfAsyncQuery() throws Exception {
583593 // Wait until at least one row has been fetched. At that moment there should be one session
584594 // checked out.
585595 dataReceived .await ();
586- if (!isMultiplexedSessionsEnabledForRW ()) {
596+ if (!isMultiplexedSessionsEnabledForRW ()) {
587597 assertThat (clientImpl .pool .getNumberOfSessionsInUse ()).isEqualTo (1 );
588598 }
589599 assertThat (res .isDone ()).isFalse ();
0 commit comments