-
Notifications
You must be signed in to change notification settings - Fork 12
fix: fix several issues in eventually_consistent #26
fix: fix several issues in eventually_consistent #26
Conversation
* 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.
PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super experienced with the global variables used in the test, but I do have a comment and a question
-
It looks like the tests aren't running as part of any checks - @JustinBeckwith is this something we should change?
-
When using global variables, is it truly possible for these tests to run independently of each other? (answer might be yes, but I just want to double check)
@leahecole I'm going to be honest here, I did not know this repository existed. The fact that tests aren't run in CI seems bad, yeah 😆 Seems like a great opportunity to use GitHub Actions since they're a lot easier to set up and use than Kokoro, and this suite probably doesn't require any private keys or such. |
Definitely yes. I'm ok with either setting up CI in this PR, or in another PR.
We need to use global variables because we're testing a decorator around the test themselves. A single variable is used only in one single test. The name of the variable matches the name of the test. |
Actually thinking more about this:
|
@JustinBeckwith Thanks! To land this module in pypi, we need to be a maintainer on this module on pypi. @theacodes @andrewsg |
SG. I set up time with Bu Sun for Wednesday @JustinBeckwith . |
fixes #25
The helper function
_retry_on_exception
didn't return the innerfunction properly so that, it is always None.
Luckily, if you pass
None
toretry_on_exception
argument, theretrying 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
andcall
.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.