-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
fix(scheduler): ensure negative intervals given to Every
return an immediate error #600
#603
Conversation
Co-authored-by: John Roesler <johnrroesler@gmail.com>
scheduler_test.go
Outdated
// do nothing | ||
}) | ||
|
||
require.EqualError(t, err, ErrInvalidInterval.Error()) |
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.
ah, the error is wrapped. So it's got another one around it. I think using require.ErrorIs
should do it
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.
thanks, I actually removed these checks as I realized there was already a bad interval test case, so I added cases to that and switched it to use contain.
What does this do?
Ensures negative intervals return an immediate error.
Which issue(s) does this PR fix/relate to?
Resolves #600
List any changes that modify/break current functionality
Negative intervals will now return an error.
Have you included tests for your changes?
Yes.
Did you document any new/modified functionality?
example_test.go
README.md
Notes
Potentially breaking change for any consumer expecting negative intervals to not return an error.