-
Notifications
You must be signed in to change notification settings - Fork 5k
otel: fix retries in otelconsumer and add receivertest test suite #45637
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
Conversation
Use the receivertest.CheckConsumeContract to test filebeatreceiver. Requires some piping to forward the unique test id attribute required by receivertest.
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/test |
85aad35
to
582b6fb
Compare
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
d396bb7
to
ef779a4
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.
Thanks for your work on this!
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.
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.
Based on Lee's approval, I'm giving mine.
@Mergifyio backport 9.0 9.1 |
✅ Backports have been created
|
…5637) * otel: use receivertest to test fbreceiver Use the receivertest.CheckConsumeContract to test filebeatreceiver. Requires some piping to forward the unique test id attribute required by receivertest. * add a mutex since Generate runs in parallel * seems like returning an error in the output disables retries * go mod tidy * make notice * fix otelconsumer tests to asser no error * fix batch test * revert otelconsumer error message * let the testing pkg remove the file when the test ends * go mod tidy * add isReceiverTest property to otelconsumer * fix typo * add doc comment for TestConsumeContract * rollback changes to go.mod and go.sum * update NOTICE.txt (cherry picked from commit ee17a83) # Conflicts: # NOTICE.txt # go.mod # x-pack/filebeat/fbreceiver/receiver_test.go # x-pack/libbeat/outputs/otelconsumer/otelconsumer.go
…5637) * otel: use receivertest to test fbreceiver Use the receivertest.CheckConsumeContract to test filebeatreceiver. Requires some piping to forward the unique test id attribute required by receivertest. * add a mutex since Generate runs in parallel * seems like returning an error in the output disables retries * go mod tidy * make notice * fix otelconsumer tests to asser no error * fix batch test * revert otelconsumer error message * let the testing pkg remove the file when the test ends * go mod tidy * add isReceiverTest property to otelconsumer * fix typo * add doc comment for TestConsumeContract * rollback changes to go.mod and go.sum * update NOTICE.txt (cherry picked from commit ee17a83) # Conflicts: # NOTICE.txt # go.mod
…5637) * otel: use receivertest to test fbreceiver Use the receivertest.CheckConsumeContract to test filebeatreceiver. Requires some piping to forward the unique test id attribute required by receivertest. * add a mutex since Generate runs in parallel * seems like returning an error in the output disables retries * go mod tidy * make notice * fix otelconsumer tests to asser no error * fix batch test * revert otelconsumer error message * let the testing pkg remove the file when the test ends * go mod tidy * add isReceiverTest property to otelconsumer * fix typo * add doc comment for TestConsumeContract * rollback changes to go.mod and go.sum * update NOTICE.txt (cherry picked from commit ee17a83) # Conflicts: # NOTICE.txt # go.mod
…ivertest test suite (#45774) * otel: fix retries in otelconsumer and add receivertest test suite (#45637) * otel: use receivertest to test fbreceiver Use the receivertest.CheckConsumeContract to test filebeatreceiver. Requires some piping to forward the unique test id attribute required by receivertest. * add a mutex since Generate runs in parallel * seems like returning an error in the output disables retries * go mod tidy * make notice * fix otelconsumer tests to asser no error * fix batch test * revert otelconsumer error message * let the testing pkg remove the file when the test ends * go mod tidy * add isReceiverTest property to otelconsumer * fix typo * add doc comment for TestConsumeContract * rollback changes to go.mod and go.sum * update NOTICE.txt (cherry picked from commit ee17a83) # Conflicts: # NOTICE.txt # go.mod * fix conflicts --------- Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
…ivertest test suite (#45773) * otel: fix retries in otelconsumer and add receivertest test suite (#45637) * otel: use receivertest to test fbreceiver Use the receivertest.CheckConsumeContract to test filebeatreceiver. Requires some piping to forward the unique test id attribute required by receivertest. * add a mutex since Generate runs in parallel * seems like returning an error in the output disables retries * go mod tidy * make notice * fix otelconsumer tests to asser no error * fix batch test * revert otelconsumer error message * let the testing pkg remove the file when the test ends * go mod tidy * add isReceiverTest property to otelconsumer * fix typo * add doc comment for TestConsumeContract * rollback changes to go.mod and go.sum * update NOTICE.txt (cherry picked from commit ee17a83) # Conflicts: # NOTICE.txt # go.mod # x-pack/filebeat/fbreceiver/receiver_test.go # x-pack/libbeat/outputs/otelconsumer/otelconsumer.go * fix conflicts * remove unused code --------- Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
…astic#45637) * otel: use receivertest to test fbreceiver Use the receivertest.CheckConsumeContract to test filebeatreceiver. Requires some piping to forward the unique test id attribute required by receivertest. * add a mutex since Generate runs in parallel * seems like returning an error in the output disables retries * go mod tidy * make notice * fix otelconsumer tests to asser no error * fix batch test * revert otelconsumer error message * let the testing pkg remove the file when the test ends * go mod tidy * add isReceiverTest property to otelconsumer * fix typo * add doc comment for TestConsumeContract * rollback changes to go.mod and go.sum * update NOTICE.txt
Proposed commit message
It appears that the otelconsumer's Publish method returning an error prevented batches from being retried, despite the batch.Retry call. As a result, events with initial errors were never delivered. Changing the return value to nil fixed the issue.
Additionally, use OTel's
receivertest.CheckConsumeContract
to test filebeatreceiver. Some piping is required to forward the unique test ID attribute expected by receivertest.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
How to test this PR locally
$ go test -timeout 5m -tags integration,unit -run ^TestConsumeContract$ ./x-pack/filebeat/fbreceiver -v -count=1 === RUN TestConsumeContract === RUN TestConsumeContract/always_succeed Sent 100, accepted=100, expected dropped=0, non-permanent errors retried=0 === RUN TestConsumeContract/random_non_permanent_error Sent 100, accepted=100, expected dropped=0, non-permanent errors retried=88 === RUN TestConsumeContract/random_permanent_error Sent 100, accepted=50, expected dropped=50, non-permanent errors retried=0 === RUN TestConsumeContract/random_error Sent 100, accepted=45, expected dropped=55, non-permanent errors retried=48 --- PASS: TestConsumeContract (12.11s) --- PASS: TestConsumeContract/always_succeed (3.03s) --- PASS: TestConsumeContract/random_non_permanent_error (3.03s) --- PASS: TestConsumeContract/random_permanent_error (3.03s) --- PASS: TestConsumeContract/random_error (3.03s) PASS ok github.com/elastic/beats/v7/x-pack/filebeat/fbreceiver 12.152s
Related issues