From 875b49f53a6c3aeec4615c7992486bd6ad5adb42 Mon Sep 17 00:00:00 2001 From: Sri Harsha CH Date: Thu, 26 Dec 2024 12:48:02 +0000 Subject: [PATCH] chore(Spanner): fix mockspanner --- .../java/com/google/cloud/spanner/MockSpannerServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java index 7febf734119..c59ad34dc69 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java @@ -2014,7 +2014,9 @@ public void commit(CommitRequest request, StreamObserver respons return; } sessionLastUsed.put(session.getName(), Instant.now()); - if (session.getMultiplexed() && !request.hasPrecommitToken()) { + if (session.getMultiplexed() + && !request.hasPrecommitToken() + && !request.hasSingleUseTransaction()) { throw Status.INVALID_ARGUMENT .withDescription( "A Commit request for a read-write transaction on a multiplexed session must specify a precommit token.")