Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
promtool unittests fail with rate() & time() #4817
What did you do?
I executed promtool in a dir with the following 2 files:
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.
Linux Fedora with promtool 2.5.0-rc2
Just to verify that
So the initial values seem to be wrong, in order to trigger the alert.
@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.
Behavior of time() function in unit tests breaks test for such alert rules: https://www.robustperception.io/get-alerted-before-your-ssl-certificates-expire
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