René's URL Explorer Experiment


Title: google-cloud-datastore no longer works with freezegun · Issue #3284 · googleapis/google-cloud-python · GitHub

Open Graph Title: google-cloud-datastore no longer works with freezegun · Issue #3284 · googleapis/google-cloud-python

X Title: google-cloud-datastore no longer works with freezegun · Issue #3284 · googleapis/google-cloud-python

Description: As of google-cloud-datastore 1.0.0 it no longer works together with freezegun. Workaround: downgrade to google-cloud-datastore 0.23.0 OS type and version: Ubuntu 17.04, but it was also reproduced on 16.04. Python version and virtual envi...

Open Graph Description: As of google-cloud-datastore 1.0.0 it no longer works together with freezegun. Workaround: downgrade to google-cloud-datastore 0.23.0 OS type and version: Ubuntu 17.04, but it was also reproduced o...

X Description: As of google-cloud-datastore 1.0.0 it no longer works together with freezegun. Workaround: downgrade to google-cloud-datastore 0.23.0 OS type and version: Ubuntu 17.04, but it was also reproduced o...

Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/3284

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"google-cloud-datastore no longer works with freezegun","articleBody":"As of `google-cloud-datastore` 1.0.0 it no longer works together with [freezegun](https://github.com/spulec/freezegun).\r\n\r\nWorkaround: downgrade to `google-cloud-datastore` 0.23.0\r\n\r\n1. OS type and version:\r\n\r\nUbuntu 17.04, but it was also reproduced on 16.04.\r\n\r\n2. Python version and virtual environment information `python --version`\r\n\r\n```\r\n$ python --version\r\nPython 3.6.0+\r\n```\r\n\r\n3. google-cloud-python version `pip show google-cloud`, `pip show google-\u003cservice\u003e` or `pip freeze`\r\n\r\n```\r\n$ pip list | grep google-cloud\r\ngapic-google-cloud-datastore-v1 0.15.3 \r\ngoogle-cloud-core               0.24.0 \r\ngoogle-cloud-datastore          1.0.0  \r\ngoogle-cloud-storage            1.0.0  \r\nproto-google-cloud-datastore-v1 0.90.3\r\n```\r\n\r\n4. Stacktrace if available\r\n\r\n\u003cdetails\u003e\u003csummary\u003epy.test --tb native\u003c/summary\u003e\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/retry.py\", line 120, in inner\r\n    return to_call(*args)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/retry.py\", line 68, in inner\r\n    return a_func(*updated_args, **kwargs)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/grpc/_channel.py\", line 507, in __call__\r\n    return _end_unary_response_blocking(state, call, False, deadline)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/grpc/_channel.py\", line 455, in _end_unary_response_blocking\r\n    raise _Rendezvous(state, None, None, deadline)\r\ngrpc._channel._Rendezvous: \u003c_Rendezvous of RPC that terminated with (StatusCode.INTERNAL, Received RST_STREAM with error code 2)\u003e\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/_gax.py\", line 74, in _catch_remap_gax_error\r\n    yield\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/_gax.py\", line 173, in commit\r\n    return super(GAPICDatastoreAPI, self).commit(*args, **kwargs)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/gapic/datastore/v1/datastore_client.py\", line 345, in commit\r\n    return self._commit(request, options)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/api_callable.py\", line 419, in inner\r\n    return api_caller(api_call, this_settings, request)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/api_callable.py\", line 407, in base_caller\r\n    return api_call(*args)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/api_callable.py\", line 368, in inner\r\n    return a_func(*args, **kwargs)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/retry.py\", line 126, in inner\r\n    ' classified as transient', exception)\r\ngoogle.gax.errors.RetryError: GaxError(Exception occurred in retry method that was not classified as transient, caused by \u003c_Rendezvous of RPC that terminated with (StatusCode.INTERNAL, Received RST_STREAM with error code 2)\u003e)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/remco/example/test.py\", line 16, in test_put_frozen\r\n    client.put(entity)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/client.py\", line 384, in put\r\n    self.put_multi(entities=[entity])\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/client.py\", line 411, in put_multi\r\n    current.commit()\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/batch.py\", line 273, in commit\r\n    self._commit()\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/batch.py\", line 249, in _commit\r\n    self.project, mode, self._mutations, transaction=self._id)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/_gax.py\", line 173, in commit\r\n    return super(GAPICDatastoreAPI, self).commit(*args, **kwargs)\r\n  File \"/usr/lib/python3.6/contextlib.py\", line 100, in __exit__\r\n    self.gen.throw(type, value, traceback)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/_gax.py\", line 82, in _catch_remap_gax_error\r\n    six.reraise(error_class, new_exc, sys.exc_info()[2])\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/six.py\", line 685, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/_gax.py\", line 74, in _catch_remap_gax_error\r\n    yield\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/datastore/_gax.py\", line 173, in commit\r\n    return super(GAPICDatastoreAPI, self).commit(*args, **kwargs)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/cloud/gapic/datastore/v1/datastore_client.py\", line 345, in commit\r\n    return self._commit(request, options)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/api_callable.py\", line 419, in inner\r\n    return api_caller(api_call, this_settings, request)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/api_callable.py\", line 407, in base_caller\r\n    return api_call(*args)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/api_callable.py\", line 368, in inner\r\n    return a_func(*args, **kwargs)\r\n  File \"/home/remco/.local/share/virtualenvs/tmp-35dac56d418be2c/lib/python3.6/site-packages/google/gax/retry.py\", line 126, in inner\r\n    ' classified as transient', exception)\r\ngoogle.cloud.exceptions.InternalServerError: 500 Received RST_STREAM with error code 2\r\n```\r\n\u003c/details\u003e\r\n\r\n5. Steps to reproduce\r\n\r\nDecorate a function using `freezegun.freeze_time` from [freezegun](https://github.com/spulec/freezegun) and put a gcloud datastore entity.\r\n\r\n6. Code example\r\n\r\n```python\r\nimport google.cloud.datastore\r\nimport pytest\r\nfrom freezegun import freeze_time\r\n\r\n\r\n# Works\r\ndef test_put():\r\n    client = google.cloud.datastore.Client()\r\n    entity = google.cloud.datastore.Entity(key=client.key('spam'))\r\n    client.put(entity)\r\n\r\n\r\n# Fails\r\n@freeze_time('3216-08-04')\r\ndef test_put_frozen():\r\n    client = google.cloud.datastore.Client()\r\n    entity = google.cloud.datastore.Entity(key=client.key('spam'))\r\n    client.put(entity)\r\n```\r\n\r\nThe datastore was launched in the background using the following code:\r\n\r\n```python\r\ndef start_datastore():\r\n    \"\"\"\r\n    Start an in memory gcloud datastore emulator.\r\n\r\n    The datastore and all of its subprocesses are killed when the Python\r\n    interpreter is shut down.\r\n\r\n    Raises:\r\n        RuntimeError: If the datastore failed to start.\r\n\r\n    \"\"\"\r\n    tmpdir = tempfile.TemporaryDirectory()\r\n    atexit.register(partial(tmpdir.cleanup))\r\n    command = (\r\n        'gcloud',\r\n        'beta',\r\n        'emulators',\r\n        'datastore',\r\n        'start',\r\n        '--project', os.environ['GOOGLE_CLOUD_PROJECT'],\r\n        '--no-store-on-disk',\r\n        '--data-dir', tmpdir.name,\r\n        '--consistency', '1.0'\r\n    )\r\n    proc = subprocess.Popen(\r\n        command,\r\n        stderr=subprocess.PIPE,\r\n        preexec_fn=os.setsid)\r\n    atexit.register(partial(os.killpg, os.getpgid(proc.pid), signal.SIGTERM))\r\n    logs = []\r\n    for lineno, line in enumerate(proc.stderr):\r\n        line = line.decode()\r\n        logs.append(line)\r\n        if 'Dev App Server is now running' in line:\r\n            return tmpdir\r\n        # At the time of writing, 22 lines were printed before the\r\n        # server was up and running. A small buffer is allowed in case\r\n        # changes are introduced in the logging output.\r\n        if lineno \u003e 40:\r\n            break\r\n    raise RuntimeError('Unable to start datastore\\n' + ''.join(logs))\r\n```","author":{"url":"https://github.com/remcohaszing","@type":"Person","name":"remcohaszing"},"datePublished":"2017-04-11T08:08:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/3284/google-cloud-python/issues/3284"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:792714ce-874c-3c32-604d-d2958748e620
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC388:384DDA:6F7C94:98ED62:6A4D448B
html-safe-noncece12a5f7b4558cc1b13e559539e7fb835148637c3946f5c36897dce484c9d50a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzg4OjM4NEREQTo2RjdDOTQ6OThFRDYyOjZBNEQ0NDhCIiwidmlzaXRvcl9pZCI6IjI3ODI0NjQxODE4OTgzOTY4MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2508ad68aab332cde3298237e3522669da0d3b248d0533695bbf2512afa8c669
hovercard-subject-tagissue:220871172
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/3284/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a9d0f91a3bf585c5bd0bf1e61c8ef7e0ca9fa49444310921c82d8bb462379e5f/googleapis/google-cloud-python/issues/3284
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a9d0f91a3bf585c5bd0bf1e61c8ef7e0ca9fa49444310921c82d8bb462379e5f/googleapis/google-cloud-python/issues/3284
og:image:altAs of google-cloud-datastore 1.0.0 it no longer works together with freezegun. Workaround: downgrade to google-cloud-datastore 0.23.0 OS type and version: Ubuntu 17.04, but it was also reproduced o...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameremcohaszing
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
turbo-cache-controlno-preview
go-importgithub.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id16316451
octolytics-dimension-repository_nwogoogleapis/google-cloud-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id16316451
octolytics-dimension-repository_network_root_nwogoogleapis/google-cloud-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release56fc8347865a14e2ec811533d68f929cf4e0ec19
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/google-cloud-python/issues/3284#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-cloud-python%2Fissues%2F3284
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-cloud-python%2Fissues%2F3284
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fgoogle-cloud-python
Reloadhttps://github.com/googleapis/google-cloud-python/issues/3284
Reloadhttps://github.com/googleapis/google-cloud-python/issues/3284
Reloadhttps://github.com/googleapis/google-cloud-python/issues/3284
Please reload this pagehttps://github.com/googleapis/google-cloud-python/issues/3284
googleapis https://github.com/googleapis
google-cloud-pythonhttps://github.com/googleapis/google-cloud-python
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Fork 1.7k https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Star 5.3k https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Code https://github.com/googleapis/google-cloud-python
Issues 437 https://github.com/googleapis/google-cloud-python/issues
Pull requests 128 https://github.com/googleapis/google-cloud-python/pulls
Discussions https://github.com/googleapis/google-cloud-python/discussions
Actions https://github.com/googleapis/google-cloud-python/actions
Projects https://github.com/googleapis/google-cloud-python/projects
Security and quality 0 https://github.com/googleapis/google-cloud-python/security
Insights https://github.com/googleapis/google-cloud-python/pulse
Code https://github.com/googleapis/google-cloud-python
Issues https://github.com/googleapis/google-cloud-python/issues
Pull requests https://github.com/googleapis/google-cloud-python/pulls
Discussions https://github.com/googleapis/google-cloud-python/discussions
Actions https://github.com/googleapis/google-cloud-python/actions
Projects https://github.com/googleapis/google-cloud-python/projects
Security and quality https://github.com/googleapis/google-cloud-python/security
Insights https://github.com/googleapis/google-cloud-python/pulse
google-cloud-datastore no longer works with freezegunhttps://github.com/googleapis/google-cloud-python/issues/3284#top
https://github.com/dhermes
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: questionRequest for information or clarification. Not an issue.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22type%3A%20question%22
https://github.com/remcohaszing
remcohaszinghttps://github.com/remcohaszing
on Apr 11, 2017https://github.com/googleapis/google-cloud-python/issues/3284#issue-220871172
freezegunhttps://github.com/spulec/freezegun
freezegunhttps://github.com/spulec/freezegun
dhermeshttps://github.com/dhermes
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: questionRequest for information or clarification. Not an issue.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22type%3A%20question%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.