From f8ed2335a605669d66d6c0940ff6b98c2070b0d6 Mon Sep 17 00:00:00 2001 From: rootkiller6788 Date: Mon, 21 Sep 2026 20:30:14 +0800 Subject: [PATCH 1/2] fix(datastore): update emulator zip checksum for 2.3.1 The checksum handed to DownloadableEmulatorRunner is still the one for the 2.0.2 archive. 9eb86f06 bumped MIN_VERSION from 2.0.2 to 2.3.1 but left MD5_CHECKSUM alone, so BaseEmulatorHelper.downloadZipFile() never finds a match: if (!zipFile.exists() || (md5CheckSum != null && !md5CheckSum.equals(md5(zipFile)))) The condition is true on every call and start() re-fetches the ~36 MB zip even when the copy in java.io.tmpdir is fine. For what it's worth, e0d1170519cf52e2e5f9f93892cdf70c is still the ETag of cloud-datastore-emulator-2.0.2.zip, which is how I noticed. The 2.3.1 object sits at 7c1f5a3276241a8f78cb1a837daaaa47 (37,929,131 bytes, matches the x-goog-hash md5 too). Fixes #12058 --- .../google/cloud/datastore/testing/LocalDatastoreHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java b/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java index 427882fd86e7..531d6fb96959 100644 --- a/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java +++ b/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java @@ -65,7 +65,7 @@ public class LocalDatastoreHelper extends BaseEmulatorHelper { // Downloadable emulator settings private static final String BIN_NAME = "cloud-datastore-emulator/cloud_datastore_emulator"; private static final String FILENAME = "cloud-datastore-emulator-" + MIN_VERSION + ".zip"; - private static final String MD5_CHECKSUM = "e0d1170519cf52e2e5f9f93892cdf70c"; + private static final String MD5_CHECKSUM = "7c1f5a3276241a8f78cb1a837daaaa47"; private static final String BIN_CMD_PORT_FLAG = "--port="; private static final URL EMULATOR_URL; private static final String EMULATOR_URL_ENV_VAR = "DATASTORE_EMULATOR_URL"; From 118752fbf3c2aab1de2e148f742c1941d3b6b641 Mon Sep 17 00:00:00 2001 From: rootkiller6788 Date: Mon, 21 Sep 2026 20:30:33 +0800 Subject: [PATCH 2/2] fix(datastore): use the resolved consistency for the gcloud runner too Spotted this while poking at the checksum above, unrelated to it. The constructor resolves consistency once, into this.consistency: this.consistency = builder.consistency > 0 ? builder.consistency : DEFAULT_CONSISTENCY; The downloadable runner's command line already reads it back via getConsistency(). The gcloud one reads builder.consistency instead, which is still 0.0 for anyone who just does LocalDatastoreHelper.newBuilder().build(). So the same helper starts gcloud with --consistency=0.0 but hands the other runner 0.9, and getConsistency() reports 0.9 either way. Use getConsistency() here as well so both paths agree. Happy to split this out or drop it if you'd rather keep the change to just the checksum. --- .../google/cloud/datastore/testing/LocalDatastoreHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java b/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java index 531d6fb96959..c71f2bde7bb9 100644 --- a/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java +++ b/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java @@ -176,7 +176,7 @@ private LocalDatastoreHelper(Builder builder) { } else { // At most one of --consistency | --use-firestore-in-datastore-mode can be specified. // --consistency will be ignored with --use-firestore-in-datastore-mode. - gcloudCommand.add(CONSISTENCY_FLAG + builder.consistency); + gcloudCommand.add(CONSISTENCY_FLAG + getConsistency()); } if (!builder.storeOnDisk) { gcloudCommand.add("--no-store-on-disk");