-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
promtool unittests fail with rate() & time() #4817
Comments
Just to verify that
So the initial values seem to be wrong, in order to trigger the alert. |
What kind of information is needed? |
@simonpasquier I retested it with promtool 2.7.2. The first test (ThanosCompactBucketOperationsFailed) now works. The second one for the Alert ThanosCompactNotRunIn24Hours still doesn't work. I'm not sure what more information you need? I expected the the time() function to resolve to some value during the unit test and then the rule should lead to an alert and a successful test. |
I will take a look at it in the coming few days, not sure how I missed it. |
I have the same issue. |
|
Behavior of time() function in unit tests breaks test for such alert rules: https://www.robustperception.io/get-alerted-before-your-ssl-certificates-expire |
This has been open a while, and I'm not seeing any bug here. I'd suggest |
Okay, so I assume the intended behavior is that time() returns the eval_time. Than it's indeed not a bug. |
I noticed that Since that wasn't mentioned here and I've been searching for it for a while, I thought it would be good to put it here as a reference for other people that might be stumbling on this. I'm also trying to get this in the |
Bug Report
What did you do?
I executed promtool in a dir with the following 2 files:
github.rules
github.rules.test.yaml
What did you expect to see?
I expected the unit test to succeed.
What did you see instead? Under which circumstances?
The unit test failed.
Environment
Linux Fedora with promtool 2.5.0-rc2
The text was updated successfully, but these errors were encountered: