This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
can not pass arguments to @eventually_consistent.call
#25
Comments
IIRC, for implementing decorators with arguments, you need to do something like: def call(*args, **kwargs):
def inner(func):
#...
return inner |
tmatsuo
pushed a commit
to tmatsuo/python-docs-samples
that referenced
this issue
Apr 3, 2020
fixes GoogleCloudPlatform#2945 fixes GoogleCloudPlatform#2818 There were 8 tests which has `time.sleep(10)` for waiting data propagation or whatever. I chose to use `@eventually_consistent.call` instead of sleep in those tests. Bonus point is now the tests are significantly faster because it doesn't always wait for 10 seconds. The downside is it will take a long time on failure. We may want to specify the retry count on the eventualy consistent decorator once the following issue is fixed: GoogleCloudPlatform/python-repo-tools#25
tmatsuo
pushed a commit
to tmatsuo/python-docs-samples
that referenced
this issue
Apr 3, 2020
fixes GoogleCloudPlatform#2945 fixes GoogleCloudPlatform#2818 There were 8 tests which has `time.sleep(10)` for waiting data propagation or whatever. I chose to use `@eventually_consistent.call` instead of sleep in those tests. Bonus point is now the tests are significantly faster because it doesn't always wait for 10 seconds. The downside is it will take a long time on failure. We may want to specify the retry count on the eventualy consistent decorator once the following issue is fixed: GoogleCloudPlatform/python-repo-tools#25
tmatsuo
pushed a commit
to tmatsuo/python-docs-samples
that referenced
this issue
Apr 3, 2020
fixes GoogleCloudPlatform#2945 fixes GoogleCloudPlatform#2818 There were 8 tests which has `time.sleep(10)` for waiting data propagation or whatever. I chose to use `@eventually_consistent.call` instead of sleep in those tests. Bonus point is now the tests are significantly faster because it doesn't always wait for 10 seconds. The downside is it will take a long time on failure. We may want to specify the retry count on the eventualy consistent decorator once the following issue is fixed: GoogleCloudPlatform/python-repo-tools#25
tmatsuo
pushed a commit
to tmatsuo/python-repo-tools
that referenced
this issue
Apr 4, 2020
* correctly handle argument provided to the decorators * provide the real callback for retry_on_exception instead of None fixes GoogleCloudPlatform#25 The helper function `_retry_on_exception` didn't return the inner function properly so that, it is always None. Luckily, if you pass `None` to `retry_on_exception` argument, the retrying module always retries as shown bellow: https://github.com/rholder/retrying/blob/1d5699348d707e377aad7488da6a8a1b48a65933/retrying.py#L139 Previously, you can not pass any arguments to the decorator `mark` and `call`. This PR will allow both syntax with or without arguments. I also added unit tests to this module. I'm not sure if we have CI builds, but the test passes locally.
tmatsuo
pushed a commit
to GoogleCloudPlatform/python-docs-samples
that referenced
this issue
Apr 7, 2020
* [jobs] testing: reduce test flakiness fixes #2945 fixes #2818 There were 8 tests which has `time.sleep(10)` for waiting data propagation or whatever. I chose to use `@eventually_consistent.call` instead of sleep in those tests. Bonus point is now the tests are significantly faster because it doesn't always wait for 10 seconds. The downside is it will take a long time on failure. We may want to specify the retry count on the eventualy consistent decorator once the following issue is fixed: GoogleCloudPlatform/python-repo-tools#25 * style fix
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I do something like:
I got:
The text was updated successfully, but these errors were encountered: