| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This is to address flaky test failures. See googleapis#535 for more discussion.
|
LGTM |
Sorry, something went wrong.
Making regression test put()'s transactional.
|
The second time regression tests were run after this PR, the flake still occurred: ======================================================================
FAIL: test_save_key_self_reference (datastore.TestDatastoreSaveKeys)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/GoogleCloudPlatform/gcloud-python/regression/datastore.py", line 158, in test_save_key_self_reference
self.assertEqual(len(stored_persons), 1)
AssertionError: 0 != 1
The code at question is with datastore.Transaction():
datastore.put([entity])
query = datastore.Query(kind='Person')
query.add_filter('linkedTo', '=', key)
stored_persons = list(query.fetch(limit=2))
self.assertEqual(len(stored_persons), 1)@pcostell does the runQuery request also need to occur transactionally to make sure this passes always? |
Sorry, something went wrong.
|
This doesn't actually do anything (a single put by itself is transactional). To make sure these tests always pass you need to make the entity have a parent then make the query do an ancestor query. |
Sorry, something went wrong.
|
Thanks. Sorry for the n00b question. I've been told that before, totally should not have forgotten. @tseaver I'll jump on fixing this. |
Sorry, something went wrong.
|
No worries, it's easy to mix up. |
Sorry, something went wrong.
Using an ancestor in queries to ensure consistency. See googleapis#562 for context.
Using an ancestor in queries to ensure consistency. See googleapis#562 for context.
Source-Link: googleapis/synthtool@fdba3ed Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:1f0dbd02745fb7cf255563dab5968345989308544e52b7f460deadd5e78e63b0
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@69fda12 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
| Back | FazBrowse Home | New Git URL |
This is to address flaky test failures.
See #535 for more discussion.