googleapis/java-datastore

LocalDatastoreHelper.reset() produces confusing error message

stickfigure opened this issue · 7 comments

Brushing the dust off an old unit test harness. It calls LocalDatastoreHelper.reset() between tests.

Running with google-cloud-datastore-2.11.3.jar, latest gcloud components update, it produces this error:

WARNING: [datastore] Cannot reset a Datastore Emulator when it is storing data on disk.
[datastore] Re-run the emulator with the --testing flag to start the emulator in-memory.

...and hangs.

Reverting google-cloud-datastore to v1.101.0 works.

The issue was introduced going from v1.103.0 to v1.104.0. Looks related to PR #137

The fix is to call setStoreOnDisk(false) when creating the helper.

This was a bit of a time suck and it's probably a good idea to fix the error message. I'll submit a PR.

Weird, ITLocalDatastoreHelperTest.testStartStopReset passes, no idea why. I have a fix that works for me and I've hit my timebox so I'll leave this issue here and skip the PR.

Thanks @stickfigure for taking a look into this!

Hi @stickfigure , Thanks for reporting this.

I was able to replicate it, and found the root cause for this.

image

emulator server was crashing when using /reset with --store-on-disk flag which is true by default.

I've fixed the issue internally and have also updated the log message with the right flag.

I will update here once it is released.

Thanks,

The fix is available in gcloud CLI 438.0.0 version and datastore emulator 2.3.1 (changelog), please upgrade gcloud cli gcloud components update --version 438.0.0.

closing this issue, feel free to open it again if the issue still persists.

Thanks,