-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Client Datastore API: default consistency of 1.0 when testing #1314
Comments
For reference, I've made a minimal reproducible suite of tests that would (within a few runs) "randomly" fail. The tests are fairly simple, so I was a little surprised that the default values bit me as they did 😉 |
@mitchhentges Thanks for you interest in google-cloud. You are right, The consistency level used by |
Other than having the same behaviour as "production" datastore, what's the point of having a "test" datastore with a default consistency of IMHO, if someone is using the Finally, to be honest, I've got everything working on my end, so this isn't an issue for me. I just don't want future consumers of the "Client Datastore API" to run into a similar issue that I did |
Some Datastore operations are eventually consistent, testing against an eventual consistent emulator is useful in all cases you want to verify that your code is not depending on strong consistency when it should not. Having your integration tests pass against a strongly consistent emulator don't necessarily guarantee that your code will also work against the actual Datastore service. Also notice that gcloud beta emulators datastore start
I am sorry you spent time on this. Probably our |
(fun 4 years update: mziccard was right, it's good to be aware of potential consistency issues in your tests, otherwise you could be surprised in production). |
…1314) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-core](https://togithub.com/googleapis/java-core) | `2.8.8` -> `2.8.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/compatibility-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/confidence-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/java-core</summary> ### [`v2.8.9`](https://togithub.com/googleapis/java-core/blob/HEAD/CHANGELOG.md#​289-httpsgithubcomgoogleapisjava-corecomparev288v289-2022-08-16) [Compare Source](https://togithub.com/googleapis/java-core/compare/v2.8.8...v2.8.9) ##### Dependencies - update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#​900](https://togithub.com/googleapis/java-core/issues/900)) ([c01b47a](https://togithub.com/googleapis/java-core/commit/c01b47a122a9036f8c594cb583dab3512a257597)) - update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#​901](https://togithub.com/googleapis/java-core/issues/901)) ([13e2fd6](https://togithub.com/googleapis/java-core/commit/13e2fd6fbae1d34385ec500aaf4a2b38e19dd6de)) - update dependency org.threeten:threetenbp to v1.6.1 ([#​902](https://togithub.com/googleapis/java-core/issues/902)) ([02dac62](https://togithub.com/googleapis/java-core/commit/02dac62784a6614291836917b022a32745312157)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNjEuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE2MS4wIn0=-->
🤖 I have created a release *beep* *boop* --- ## [3.6.0](googleapis/java-asset@v3.5.0...v3.6.0) (2022-09-15) ### Features * Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API ([3919a1d](googleapis/java-asset@3919a1d)) * Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API ([#1300](googleapis/java-asset#1300)) ([3919a1d](googleapis/java-asset@3919a1d)) * Release of query system ([3919a1d](googleapis/java-asset@3919a1d)) ### Dependencies * Update dependency com.google.api.grpc:proto-google-cloud-orgpolicy-v1 to v2.3.2 ([#1302](googleapis/java-asset#1302)) ([d01d900](googleapis/java-asset@d01d900)) * Update dependency com.google.api.grpc:proto-google-cloud-orgpolicy-v1 to v2.3.3 ([#1332](googleapis/java-asset#1332)) ([c1511c2](googleapis/java-asset@c1511c2)) * Update dependency com.google.api.grpc:proto-google-cloud-os-config-v1 to v2.5.2 ([#1309](googleapis/java-asset#1309)) ([cf96ee9](googleapis/java-asset@cf96ee9)) * Update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.102.11 ([#1297](googleapis/java-asset#1297)) ([d56eedd](googleapis/java-asset@d56eedd)) * Update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.102.12 ([#1316](googleapis/java-asset#1316)) ([a3713fd](googleapis/java-asset@a3713fd)) * Update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.102.13 ([#1321](googleapis/java-asset#1321)) ([883b7b8](googleapis/java-asset@883b7b8)) * Update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.102.14 ([#1334](googleapis/java-asset#1334)) ([56cb4b4](googleapis/java-asset@56cb4b4)) * Update dependency com.google.api.grpc:proto-google-identity-accesscontextmanager-v1 to v1.4.1 ([#1307](googleapis/java-asset#1307)) ([b90baf7](googleapis/java-asset@b90baf7)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.14.4 ([#1301](googleapis/java-asset#1301)) ([64f7ea5](googleapis/java-asset@64f7ea5)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.14.6 ([#1315](googleapis/java-asset#1315)) ([fa179e2](googleapis/java-asset@fa179e2)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.14.7 ([#1320](googleapis/java-asset#1320)) ([06d1a16](googleapis/java-asset@06d1a16)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.15.0 ([#1326](googleapis/java-asset#1326)) ([df36595](googleapis/java-asset@df36595)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.16.0 ([#1336](googleapis/java-asset#1336)) ([870779d](googleapis/java-asset@870779d)) * Update dependency com.google.cloud:google-cloud-core to v2.8.10 ([#1323](googleapis/java-asset#1323)) ([09e03b8](googleapis/java-asset@09e03b8)) * Update dependency com.google.cloud:google-cloud-core to v2.8.11 ([#1331](googleapis/java-asset#1331)) ([a112cec](googleapis/java-asset@a112cec)) * Update dependency com.google.cloud:google-cloud-core to v2.8.9 ([#1314](googleapis/java-asset#1314)) ([8edc2b8](googleapis/java-asset@8edc2b8)) * Update dependency com.google.cloud:google-cloud-pubsub to v1.120.11 ([#1298](googleapis/java-asset#1298)) ([172b34b](googleapis/java-asset@172b34b)) * Update dependency com.google.cloud:google-cloud-pubsub to v1.120.12 ([#1317](googleapis/java-asset#1317)) ([1ea636f](googleapis/java-asset@1ea636f)) * Update dependency com.google.cloud:google-cloud-pubsub to v1.120.13 ([#1322](googleapis/java-asset#1322)) ([b7522b9](googleapis/java-asset@b7522b9)) * Update dependency com.google.cloud:google-cloud-pubsub to v1.120.14 ([#1335](googleapis/java-asset#1335)) ([e9142b4](googleapis/java-asset@e9142b4)) * Update dependency com.google.cloud:google-cloud-resourcemanager to v1.5.3 ([#1318](googleapis/java-asset#1318)) ([aa3a1bb](googleapis/java-asset@aa3a1bb)) * Update dependency com.google.cloud:google-cloud-resourcemanager to v1.5.4 ([#1328](googleapis/java-asset#1328)) ([fca0ce5](googleapis/java-asset@fca0ce5)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#1330](googleapis/java-asset#1330)) ([ccb704c](googleapis/java-asset@ccb704c)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#1340](googleapis/java-asset#1340)) ([0d87a9d](googleapis/java-asset@0d87a9d)) * Update dependency com.google.cloud:google-cloud-storage to v2.11.3 ([#1299](googleapis/java-asset#1299)) ([d59e6c6](googleapis/java-asset@d59e6c6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
I just spent a few hours debugging flaky tests, and I finally realized that it was due to the "consistency" settings that I was using.
When
LocalDatastoreHelper.create()
is called, perhaps a default consistency of1.0
should be used? Otherwise, integration tests to verify proper API usage will "randomly" fail, even if the tests are fairly small.The text was updated successfully, but these errors were encountered: