Skip to content

Conversation

@harshachinta
Copy link
Contributor

No description provided.

@harshachinta harshachinta requested review from a team as code owners February 11, 2025 13:33
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner API. labels Feb 11, 2025
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Feb 11, 2025
}

@Test
public void testRetryUsesPreviousTransactionIdOnMultiplexedSession() {
Copy link
Contributor Author

@harshachinta harshachinta Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this unit test since it is not possible to change the txnstate to ABORTED of the TransactionManager using unit tests. This is needed since we are calling resetForRetryAsync, which will fail if transactionstate is not ABORTED.

We have same tests covered in mock spanner

public class MultiplexedSessionDatabaseClientMockServerTest extends AbstractMockServerTest {

}
}
dbClient.write(mutations);
if (mutations.size() > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do we really need this check? (and if so, could we change is to !mutations.isEmpty())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that at this point, there are no mutations to commit, making the db.write call unnecessary. Adding a check for pending mutations before committing will avoid an unnecessary backend call and save some time in our tests, though the improvement is minimal.

@harshachinta harshachinta added the automerge Merge the pull request once unit tests and other checks pass. label Feb 11, 2025
@gcf-merge-on-green gcf-merge-on-green bot merged commit c74369b into googleapis:main Feb 11, 2025
31 of 33 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Feb 11, 2025
@suztomo suztomo mentioned this pull request Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants