-
Notifications
You must be signed in to change notification settings - Fork 2.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
Idea: add correctness tests #2511
Comments
Is it doable in our e2e? We can start one Promethues, one sidecar and a querier. And simply compare the query results of Prometheus and querier. https://github.com/prometheus/prometheus/tree/master/promql/testdata is great. But is it easy to add the metrics we need into the e2e Prometheus? The testdata is coupled with https://github.com/prometheus/prometheus/blob/84b4d079c8714be8e8ad071a35b0391df270364c/promql/test.go#L65:1 test framework. Maybe we can extend the thanosbench. Put all the functionalities there. |
I think this type of thing is typically referred to as model based testing. I'm 100% for this! Thanos receive definitely could benefit from testing like this a lot as well! (eg. comparing single node vs sharded+replicated setups) I think this would make a nice GSoC project as well, and could even teach students about distributed systems correctness. |
I think that in particular correctness of the interaction between compactor and stores would GREATLY benefit from this. There is a lot of subtlety in the interaction between all of the different metas, deletion markers etc |
Hello 👋 Looks like there was no activity on this issue for last 30 days. |
Still valid. |
Hello 👋 Looks like there was no activity on this issue for last 30 days. |
Hello 👋 Looks like there was no activity on this issue for last 30 days. |
Hello 👋 Looks like there was no activity on this issue for last 30 days. |
https://promlabs.com/blog/2020/08/06/comparing-promql-correctness-across-vendors tests were performed here but I guess it'd be nice to have something in the CI pipeline as well |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
No updates from me :/ still valid IMHO |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
Actually, #3631 is a start for this :P It's a bit different but still a step towards having automatic tests for PromQL compliance. |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
Is this still valid? There is promql compliance test |
Don't think so, closing! |
Between the query that the users send to Thanos and what is actually used in the code some translation happens. For example, some translation happens here https://github.com/thanos-io/thanos/blob/55cb8ca38b3539381dc6a781e637df15c694e50a/pkg/store/matchers.go and
thanos/pkg/query/querier.go
Lines 151 to 171 in 0bb67bc
This came up from #2245. We could protect ourselves against this by running some kind of correctness tests.
Some ideas below.
We could add another e2e scenario where a block would be generated with known data that then would be added to a Prometheus instance that has Sidecar in front of it + uploaded to some remote storage that is picked up by Thanos Store. Then, we could run some (randomly generated) queries and see if we get the same results. In all of the cases, they should be the same if everything is correct.
I haven't looked into the Prometheus side of this too much but I have found that there is some kind of PromQL test suite: https://github.com/prometheus/prometheus/tree/master/promql/testdata. Perhaps we could adapt it and reuse the same?
Cortex has this A/B testing tool cortexproject/cortex#2203. It could also be extended to include correctness tests.
Perhaps there is some kind of PromQL fuzzer that I am not aware of? :P Downsampled data probably shouldn't be a part of this.
Thoughts? :)
/cc @yeya24
The text was updated successfully, but these errors were encountered: