Skip to content

Commit 27057ec

Browse files
committed
chore(spanner): run .write only if there are any mutations to commit
1 parent eb64335 commit 27057ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ public static void setUpDatabase() throws Exception {
181181
totalSize = 0;
182182
}
183183
}
184-
dbClient.write(mutations);
184+
if (mutations.size() > 0) {
185+
dbClient.write(mutations);
186+
}
185187
}
186188
// Our read/queries are executed with some staleness.
187189
Thread.sleep(2 * STALENESS_MILLISEC);

0 commit comments

Comments
 (0)