Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalDatastoreHelper.reset() produces confusing error message #838

Closed
stickfigure opened this issue Sep 23, 2022 · 7 comments
Closed

LocalDatastoreHelper.reset() produces confusing error message #838

stickfigure opened this issue Sep 23, 2022 · 7 comments
Assignees
Labels
api: datastore Issues related to the googleapis/java-datastore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@stickfigure
Copy link

stickfigure commented Sep 23, 2022

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.

@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/java-datastore API. label Sep 23, 2022
@stickfigure
Copy link
Author

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

@stickfigure stickfigure changed the title "[datastore] Re-run the emulator with the --testing flag to start the emulator in-memory" LocalDatastoreHelper.reset() no longer works Sep 23, 2022
@stickfigure
Copy link
Author

stickfigure commented Sep 23, 2022

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

@stickfigure
Copy link
Author

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.

@stickfigure
Copy link
Author

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.

@stickfigure stickfigure changed the title LocalDatastoreHelper.reset() no longer works LocalDatastoreHelper.reset() produces confusing error message Sep 23, 2022
@kolea2
Copy link
Collaborator

kolea2 commented Sep 30, 2022

Thanks @stickfigure for taking a look into this!

@kolea2 kolea2 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Sep 30, 2022
@jainsahab
Copy link
Member

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,

@jainsahab
Copy link
Member

jainsahab commented Jul 12, 2023

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/java-datastore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants