Sitelet https://github.com/googleapis/google-cloud-java/issues/1300
Skip to content

It is too slow testing Datastore locally when use LocalDatastoreHelper #1300

Description

@pauloleitemoreira

It is too slow testing Datastore locally when we use com.google.cloud.datastore.testing.LocalDatastoreHelper in google-cloud-0.4.0 with cloud-datastore-emulator 1.2.1.

I figure out LocalDatastoreHelper define private static final String GCD_VERSION = "1.2.0"; and lastest gcloud datastore version is cloud-datastore-emulator 1.2.1 (gcloud-tools current version is 128.0.0). So, when we test by using LocalDatastoreHelper, it cannot find the cloud-datastore-emulator 1.2.0 version in gcloud path, and as result, it ends up making download of cloud-datastore-emulator 1.2.1 for each test case.

To solve this problem, I had to downgrade the gcloud-tools to 125.0.0.

Activity

  1. mziccard commented on Sep 30, 2016

    @mziccard
    Contributor

    @pauloleitemoreira thanks for the report.
    You are right, there are 2 problems here:

    1. The version we specify in GCD_VERSION is the minimum required to successfully run the tests. We allow using an already installed version of the emulator but only if the version is an exact match (we don't check if the installed version is more recent yet). This is something we need to fix.
    2. It's odd that the emulator is re-downloaded with every test case. LocalDatastoreHelper should reuse previously downloaded emulators. This is a bug that you spotted, we did not update the value of MD5_CHECKSUM to match version 1.2.0, hence the emulator is always re-downloaded.

    I can fix 2. right away. I'll need some more time to start working on 1.

  2. added a commit that references this issue on Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions