-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
exporter/prometheusremotewriteexporter: import and add official compliance tests. #5014
exporter/prometheusremotewriteexporter: import and add official compliance tests. #5014
Conversation
96d2db3
to
768db57
Compare
768db57
to
834d67c
Compare
/cc @odeke-em |
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.
LGTM, thank you @kirbyquerby! Minor nit, please examine the 10s artificial sleep and also add a function to properly shut down lest we'll encounter race conditions with the OpenTelemetry service as I've encountered before.
app := startCollector(t, l.Addr()) | ||
defer app.Shutdown() | ||
|
||
time.Sleep(10 * time.Second) |
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.
Why this artificial sleep? Could we perhaps reduce this as much.
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.
The 10s sleep comes from the original tests: https://github.com/prometheus/compliance/blob/main/remote_write/main_test.go#L102
The collector process is interrupted after TIMEOUT seconds: https://github.com/prometheus/compliance/blob/main/remote_write/targets/common.go#L276
We can potentially lower timeout by some amount without causing flakiness. Once we fix the go modules issues, I can try playing around with lower values.
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.
No worries, we can keep them as they are.
exporter/prometheusremotewriteexporter/compliance/compliance_test.go
Outdated
Show resolved
Hide resolved
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 for the review Emmanuel!
exporter/prometheusremotewriteexporter/compliance/compliance_test.go
Outdated
Show resolved
Hide resolved
app := startCollector(t, l.Addr()) | ||
defer app.Shutdown() | ||
|
||
time.Sleep(10 * time.Second) |
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.
The 10s sleep comes from the original tests: https://github.com/prometheus/compliance/blob/main/remote_write/main_test.go#L102
The collector process is interrupted after TIMEOUT seconds: https://github.com/prometheus/compliance/blob/main/remote_write/targets/common.go#L276
We can potentially lower timeout by some amount without causing flakiness. Once we fix the go modules issues, I can try playing around with lower values.
Kindly requesting y'all eyes @Aneurysm9 @bogdandrutu @tigrannajaryan. |
4472318
to
bfbf0ca
Compare
Kindly pinging y'all, it's been 11 days and the PR is getting stale. Kindly cc-ing @dashpole |
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.
Code looks good, please address the conflicts. It looks like lint and the tests are failing as well:
exporter/prometheusremotewriteexporter/compliance/compliance_test.go: Expected no more than 3 groups, got 4
bfbf0ca
to
3f08474
Compare
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.
LGTM!
3f08474
to
b6d628c
Compare
There are currently data races in the compliance tests (and in the collector) that cause this test to fail with |
The CI check failures appear to be caused elsewhere. See this clean PR which also fails checks: #5228 |
96c17df
to
95ce1cc
Compare
I was mistaken :) |
@codeboten please take a look again. The Prometheus Remote Writer test code has data races they'll need to fix. On our end though we are good to go. |
7ea9db7
to
8bf4140
Compare
Kindly cc-ing @alolita @bogdandrutu @codeboten @Aneurysm9 to take a look before this PR gets stale again, thank you! |
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 suspect another make gotidy
is needed here to address the conflicts.
055d1b2
to
24bcded
Compare
Rebased + gotidied. Thanks for the review Alex! |
e5803c7
to
9751f72
Compare
…iance tests. run make gotidy run make gotidy again ???????? run go mod tidy manually in prometheusexporter run make gotidy after rebasing make gotidy manually run go mod tidy in prometheusexporter
9751f72
to
cf48dff
Compare
|
||
var ( | ||
logger = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)) | ||
tests = []func() cases.Test{ |
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 sure that duplicating the test harness here is the best approach. Can we instead have an action that runs on PR that pulls the compliance test repo and runs the tests there against a build artifact?
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.
Sure, I've made #5739
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Please resolve the conflicts and address/resolve remaining open comments. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
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.
@kirbyquerby can this be closed as superseeded by #5739?
@codeboten Yeah :D |
Description: exporter/prometheusremotewrite: import and add official compliance tests.
This change imports and runs the official Prometheus Remote Write compliance tests from https://github.com/prometheus/compliance against a live collector end-to-end. Due to data races in the official tests, this test is currently skipped.
Link to tracking Issue: Fixes open-telemetry/prometheus-interoperability-spec/issues/34
Testing: This change itself is a test :)